<?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>code name &#187; Main</title>
	<atom:link href="http://victorsergienko.com/category/main/feed/" rel="self" type="application/rss+xml" />
	<link>http://victorsergienko.com</link>
	<description>Programming: Java, Groovy, C++, .NET, OOD, a little this and that</description>
	<lastBuildDate>Wed, 11 Apr 2012 13:15:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Got a StackOverflow careers invitation.</title>
		<link>http://victorsergienko.com/got-a-stackoverflow-careers-invitation/</link>
		<comments>http://victorsergienko.com/got-a-stackoverflow-careers-invitation/#comments</comments>
		<pubDate>Thu, 04 Aug 2011 13:51:26 +0000</pubDate>
		<dc:creator>Victor Sergienko</dc:creator>
				<category><![CDATA[Main]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[howdy]]></category>

		<guid isPermaLink="false">http://victorsergienko.com/?p=173</guid>
		<description><![CDATA[They do a pretty cool thing: force you to tell &#8220;the truth&#8221; — no matter how subjective this term is — as opposed to emasculated official style: what you really did (whatever it means to you); what opensource/published projects did you participate in; Top Stack questions you answered; your professional reading and (sic!) writing. Here [...]]]></description>
			<content:encoded><![CDATA[<p>They do a pretty cool thing: force you to tell &#8220;the truth&#8221; — no matter how subjective this term is — as opposed to emasculated official style:</p>
<ul>
<li>what you really did (whatever it means to you);</li>
<li>what opensource/published projects did you participate in;</li>
<li>Top Stack questions you answered;</li>
<li>your professional reading and (sic!) writing.</li>
</ul>
<p>Here I am: <a href="http://careers.stackoverflow.com/victors">http://careers.stackoverflow.com/victors</a><br />
(have to complete it still)</p>
<p>Got 5 invites btw.<br />
Actually, just testing a new <a href="http://code.google.com/p/ljxp/">LiveJournal crosspost plugin</a>.</p>
<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:70px;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fvictorsergienko.com%2Fgot-a-stackoverflow-careers-invitation%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe></div><div class="really_simple_share_google1" style="width:60px;"><div class="g-plusone" data-size="medium" data-href="http://victorsergienko.com/got-a-stackoverflow-careers-invitation/" data-annotation="none"></div></div><div class="really_simple_share_twitter" style="width:70px;"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none" 
						data-text="Got a StackOverflow careers invitation." data-url="http://victorsergienko.com/got-a-stackoverflow-careers-invitation/" 
						data-via=""  ></a></div></div>
		<div style="clear:both;"></div>]]></content:encoded>
			<wfw:commentRss>http://victorsergienko.com/got-a-stackoverflow-careers-invitation/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Why I don&#8217;t like GMock</title>
		<link>http://victorsergienko.com/why-i-dont-like-gmock/</link>
		<comments>http://victorsergienko.com/why-i-dont-like-gmock/#comments</comments>
		<pubDate>Wed, 16 Feb 2011 10:55:51 +0000</pubDate>
		<dc:creator>Victor Sergienko</dc:creator>
				<category><![CDATA[Main]]></category>
		<category><![CDATA[GMock]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[TDD]]></category>

		<guid isPermaLink="false">http://victorsergienko.com/?p=161</guid>
		<description><![CDATA[I don&#8217;t like GMock. It&#8217;s not as if it was badly written or designed. But it lets you to unit-test dirtier code, tying to method call structure instead of resulting data. For instance, this GMock code can be rewritten: loggingService.sendNotification(match{ !it.shouldNotify() }).stub() loggingService.sendNotification(match { it.shouldNotify() &#38;&#38; it instanceof HubOfflineNotification &#38;&#38; it.deadEntities == [hub] }) loggingService.saveEvent(LogEventType.HUB_BECAME_OFFLINE, [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t like <a href="http://gmock.org/">GMock</a>.</p>
<p>It&#8217;s not as if it was badly written or designed. But it lets you to unit-test dirtier code, tying to method call structure instead of resulting data.</p>
<p>For instance, this GMock code can be rewritten:<br />
<span id="more-161"></span></p>
<pre class="brush: php">
        loggingService.sendNotification(match{ !it.shouldNotify() }).stub()
        loggingService.sendNotification(match {
            it.shouldNotify() &amp;&amp; it instanceof HubOfflineNotification &amp;&amp; it.deadEntities == [hub]
        })
        loggingService.saveEvent(LogEventType.HUB_BECAME_OFFLINE, match { it }, customer)
        loggingService.saveEvent(LogEventType.CAMERA_DIED, match { it }, customer).never()

        play {
            loggingService.reportHealth(diff)
        }
</pre>
<p>to:</p>
<pre class="brush: php">
        eventLogService.reportHealthDiff(diff)

        assertEquals 1, LogEvent.countByEventType(LogEventType.AGENT_BECAME_OFFLINE)
        assertEquals 0, LogEvent.countByEventType(LogEventType.METER_BECAME_DEAD)
        assertEquals 1, LogEvent.countByEventType(LogEventType.SENDING_NOTIFICATION)
</pre>
<p>which relies only to call outcome, and not to implementation details.</p>
<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:70px;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fvictorsergienko.com%2Fwhy-i-dont-like-gmock%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe></div><div class="really_simple_share_google1" style="width:60px;"><div class="g-plusone" data-size="medium" data-href="http://victorsergienko.com/why-i-dont-like-gmock/" data-annotation="none"></div></div><div class="really_simple_share_twitter" style="width:70px;"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none" 
						data-text="Why I don&#8217;t like GMock" data-url="http://victorsergienko.com/why-i-dont-like-gmock/" 
						data-via=""  ></a></div></div>
		<div style="clear:both;"></div>]]></content:encoded>
			<wfw:commentRss>http://victorsergienko.com/why-i-dont-like-gmock/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Groovy Comparator for class field names</title>
		<link>http://victorsergienko.com/groovy-comparator-for-class-field-names/</link>
		<comments>http://victorsergienko.com/groovy-comparator-for-class-field-names/#comments</comments>
		<pubDate>Tue, 15 Feb 2011 14:23:19 +0000</pubDate>
		<dc:creator>Victor Sergienko</dc:creator>
				<category><![CDATA[Main]]></category>
		<category><![CDATA[groovy]]></category>

		<guid isPermaLink="false">http://victorsergienko.com/?p=157</guid>
		<description><![CDATA[I wonder why this was not in JDK/Groovy Collections. Just put together a Comparator for StackOverflow question &#8211; a Groovy Comparator that would sort class field names in the declaration order. Feel free to use: class PropComparator implements Comparator { private Class clazz PropComparator(Class clazz) { this.clazz = clazz } int compare(Object o1, Object o2) [...]]]></description>
			<content:encoded><![CDATA[<p>I wonder why this was not in JDK/Groovy Collections.</p>
<p>Just put together a Comparator for StackOverflow question &#8211; a Groovy Comparator that would sort class field names in the declaration order. Feel free to use:</p>
<p><code>
<pre>class PropComparator implements Comparator {
    private Class clazz
    PropComparator(Class clazz) { this.clazz = clazz }

    int compare(Object o1, Object o2) {
        clazz.declaredFields.findIndexOf{it.name == o1}
          - clazz.declaredFields.findIndexOf{it.name == o2}
    }
}</pre>
<p></code></p>
<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:70px;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fvictorsergienko.com%2Fgroovy-comparator-for-class-field-names%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe></div><div class="really_simple_share_google1" style="width:60px;"><div class="g-plusone" data-size="medium" data-href="http://victorsergienko.com/groovy-comparator-for-class-field-names/" data-annotation="none"></div></div><div class="really_simple_share_twitter" style="width:70px;"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none" 
						data-text="Groovy Comparator for class field names" data-url="http://victorsergienko.com/groovy-comparator-for-class-field-names/" 
						data-via=""  ></a></div></div>
		<div style="clear:both;"></div>]]></content:encoded>
			<wfw:commentRss>http://victorsergienko.com/groovy-comparator-for-class-field-names/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>DB2 supports LIMIT and OFFSET syntax, in MySQL compatibility layer&#8230;</title>
		<link>http://victorsergienko.com/db2-supports-limit-and-offset/</link>
		<comments>http://victorsergienko.com/db2-supports-limit-and-offset/#comments</comments>
		<pubDate>Mon, 29 Nov 2010 13:28:35 +0000</pubDate>
		<dc:creator>Victor Sergienko</dc:creator>
				<category><![CDATA[Main]]></category>

		<guid isPermaLink="false">http://victorsergienko.com/?p=133</guid>
		<description><![CDATA[It hasn&#8217;t even been a ten years that DB2, one of the most, er, expensive DBMSes, got a feature needed by every other application &#8211; dataset paging. Before, you had to use window functions rownumber() and fetch first 40 rows only. When used by Hibernate, this resulted ugliness like: select * from ( select inner2_.*, [...]]]></description>
			<content:encoded><![CDATA[<p>It hasn&#8217;t even been a ten years that DB2, one of the most, er, expensive DBMSes, got a feature needed by every other application &#8211; dataset paging.</p>
<p>Before, you had to use <a href="http://en.wikipedia.org/wiki/SQL_window_function#Limiting_result_rows">window functions</a> <strong>rownumber()</strong> and <strong>fetch first 40 rows only</strong>. When used by Hibernate, this resulted ugliness like:</p>
<pre class="brush: sql">
select * from (
  select inner2_.*, rownumber() over(order by order of inner2_) as rownumber_
  from (
    select  ...
    fetch first 40 rows only
    ) as inner2_
  ) as inner1_
where rownumber_ &gt; 20
order by rownumber_
</pre>
<p>Since this summer version &#8211; DB2 9.7.2 &#8211; you can just append LIMIT and OFFSET:<span id="more-133"></span></p>
<pre class="brush: sql">SELECT ... LIMIT 5 OFFSET 10</pre>
<p>No wrapping into 2 (!!!) external SELECTs.<br />
One downside is that mighty DB2 does have MySQL compatibility layer mode. Turn it on when starting DB2:</p>
<pre class="brush: bash">
$ db2set DB2_COMPATIBILITY_VECTOR=MYS
$ db2stop
$ db2start
</pre>
<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:70px;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fvictorsergienko.com%2Fdb2-supports-limit-and-offset%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe></div><div class="really_simple_share_google1" style="width:60px;"><div class="g-plusone" data-size="medium" data-href="http://victorsergienko.com/db2-supports-limit-and-offset/" data-annotation="none"></div></div><div class="really_simple_share_twitter" style="width:70px;"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none" 
						data-text="DB2 supports LIMIT and OFFSET syntax, in MySQL compatibility layer&#8230;" data-url="http://victorsergienko.com/db2-supports-limit-and-offset/" 
						data-via=""  ></a></div></div>
		<div style="clear:both;"></div>]]></content:encoded>
			<wfw:commentRss>http://victorsergienko.com/db2-supports-limit-and-offset/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Buzz button for WordPress</title>
		<link>http://victorsergienko.com/google-buzz-button-for-wordpress/</link>
		<comments>http://victorsergienko.com/google-buzz-button-for-wordpress/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 10:09:44 +0000</pubDate>
		<dc:creator>Victor Sergienko</dc:creator>
				<category><![CDATA[Main]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://victorsergienko.com/?p=116</guid>
		<description><![CDATA[Just installed a shiny new Google Buzz button for WordPress by Tejaswini, Sanjeev. I hacked it a bit, to align to the right. Download this plugin version here, until author updates it. I&#8217;m replacing a diggIt button; Buzz fits my color scheme better Enjoy.]]></description>
			<content:encoded><![CDATA[<p>Just installed a shiny new <a href="http://www.clickonf5.org/google-buzz-button-wordpress">Google Buzz button for WordPress by Tejaswini, Sanjeev</a>.<br />
I hacked it a bit, to align to the right. <a href="http://victorsergienko.com/files/google-buzz-button-1.1.zip">Download this plugin version here</a>, until author updates it.</p>
<p>I&#8217;m replacing a diggIt button; Buzz fits my color scheme better <img src='http://victorsergienko.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Enjoy.</p>
<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:70px;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fvictorsergienko.com%2Fgoogle-buzz-button-for-wordpress%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe></div><div class="really_simple_share_google1" style="width:60px;"><div class="g-plusone" data-size="medium" data-href="http://victorsergienko.com/google-buzz-button-for-wordpress/" data-annotation="none"></div></div><div class="really_simple_share_twitter" style="width:70px;"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none" 
						data-text="Google Buzz button for WordPress" data-url="http://victorsergienko.com/google-buzz-button-for-wordpress/" 
						data-via=""  ></a></div></div>
		<div style="clear:both;"></div>]]></content:encoded>
			<wfw:commentRss>http://victorsergienko.com/google-buzz-button-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;group by&#8221; clause in GORM/HibernateCriteriaBuilder</title>
		<link>http://victorsergienko.com/group-by-clause-in-gormhibernatecriteriabuilder/</link>
		<comments>http://victorsergienko.com/group-by-clause-in-gormhibernatecriteriabuilder/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 17:33:08 +0000</pubDate>
		<dc:creator>Victor Sergienko</dc:creator>
				<category><![CDATA[Main]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[Hibernate]]></category>

		<guid isPermaLink="false">http://victorsergienko.com/?p=110</guid>
		<description><![CDATA[Just in case someone needs a code snippet. This one groups Prices by PriceProvider and was intended to pick only last 5 values for each PriceProvider – but sadly, it&#8217;s impossible without window functions. Which are not supported in Hibernate in any way. def c = Price.createCriteria() c.list { priceProvider { company { country { [...]]]></description>
			<content:encoded><![CDATA[<p>Just in case someone needs a code snippet.<br />
This one groups Prices by PriceProvider and was intended to pick only last 5 values for each PriceProvider – but sadly, it&#8217;s impossible without <a href="http://en.wikipedia.org/wiki/Window_function_%28SQL%29#Window_function">window functions</a>. Which are not supported in Hibernate in any way.<br />
<span id="more-110"></span></p>
<pre><code>def c = <span style="color: #00007F; font-weight: bold;">Price</span>.createCriteria()
c.list {
    <span style="color: black;">priceProvider</span> {
        <span style="color: black;">company</span> {
            <span style="color: black;">country</span> {
                <span style="color: black;">eq</span>(<span style="color: red;">'currency.id'</span>, 1L)
            }
        }
    }
    <span style="color: black;">projection</span>(
       groupProperty(<span style="color: red;">'id'</span>)
    )
    <span style="color: black;">order</span>(<span style="color: red;">'timestamp'</span>, <span style="color: red;">'desc'</span>)
}</code></pre>
<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:70px;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fvictorsergienko.com%2Fgroup-by-clause-in-gormhibernatecriteriabuilder%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe></div><div class="really_simple_share_google1" style="width:60px;"><div class="g-plusone" data-size="medium" data-href="http://victorsergienko.com/group-by-clause-in-gormhibernatecriteriabuilder/" data-annotation="none"></div></div><div class="really_simple_share_twitter" style="width:70px;"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none" 
						data-text="&#8220;group by&#8221; clause in GORM/HibernateCriteriaBuilder" data-url="http://victorsergienko.com/group-by-clause-in-gormhibernatecriteriabuilder/" 
						data-via=""  ></a></div></div>
		<div style="clear:both;"></div>]]></content:encoded>
			<wfw:commentRss>http://victorsergienko.com/group-by-clause-in-gormhibernatecriteriabuilder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hibernate join bug</title>
		<link>http://victorsergienko.com/hibernate-join-bug-createfromjoinelement/</link>
		<comments>http://victorsergienko.com/hibernate-join-bug-createfromjoinelement/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 17:35:44 +0000</pubDate>
		<dc:creator>Victor Sergienko</dc:creator>
				<category><![CDATA[Main]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[Hibernate]]></category>
		<category><![CDATA[HQL]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://victorsergienko.com/?p=102</guid>
		<description><![CDATA[Hibernate bug 1895 seems to be still there since 2006. If, for instance, in Grails, such a syntax won&#8217;t work for you (it won&#8217;t): def books = Book.findAll("FROM Book AS b JOIN Chapter AS c WHERE c.active = :isActive") with a NullPointerException in &#8220;HqlSqlWalker.createFromJoinElement&#8221; &#8212; just use alternative join syntax, via WHERE: def books = [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://opensource.atlassian.com/projects/hibernate/browse/HHH-1895">Hibernate bug 1895</a> seems to be still there since 2006.<br />
If, for instance, in Grails, such a syntax won&#8217;t work for you (it won&#8217;t):</p>
<p><code>def books = Book.findAll("FROM Book AS b JOIN Chapter AS c WHERE c.active = :isActive")</code></p>
<p>with a NullPointerException in &#8220;HqlSqlWalker.createFromJoinElement&#8221; &mdash; just use alternative join syntax, via WHERE:</p>
<p><code>def books = Book.executeQuery("select b FROM Book AS b, Chapter AS c WHERE c.active = :isActive")</code></p>
<p>Move <a href="http://docs.jboss.org/hibernate/stable/core/reference/en/html/queryhql.html#queryhql-joins">&#8220;WITH&#8221;</a> conditions to &#8220;WHERE&#8221; as needed.</p>
<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:70px;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fvictorsergienko.com%2Fhibernate-join-bug-createfromjoinelement%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe></div><div class="really_simple_share_google1" style="width:60px;"><div class="g-plusone" data-size="medium" data-href="http://victorsergienko.com/hibernate-join-bug-createfromjoinelement/" data-annotation="none"></div></div><div class="really_simple_share_twitter" style="width:70px;"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none" 
						data-text="Hibernate join bug" data-url="http://victorsergienko.com/hibernate-join-bug-createfromjoinelement/" 
						data-via=""  ></a></div></div>
		<div style="clear:both;"></div>]]></content:encoded>
			<wfw:commentRss>http://victorsergienko.com/hibernate-join-bug-createfromjoinelement/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Unit tests quickstart</title>
		<link>http://victorsergienko.com/unit-tests-quickstart/</link>
		<comments>http://victorsergienko.com/unit-tests-quickstart/#comments</comments>
		<pubDate>Tue, 24 Jun 2008 11:57:24 +0000</pubDate>
		<dc:creator>Victor Sergienko</dc:creator>
				<category><![CDATA[Main]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://victorsergienko.com/?p=47</guid>
		<description><![CDATA[A friend asked me for it, so probably someone might need a jumpstart in unit tests. Here&#8217;s a short list of short (though very deep, if not best) intros. Except for JUnit cookbook (~2 pages) (which has a lot of &#8220;ports&#8221;, like CppUnit cookbook), I&#8217;d name: &#8220;Endo-Testing: Unit Testing with Mock Objects&#8221; at mockobjects.com (Tim [...]]]></description>
			<content:encoded><![CDATA[<p>A friend asked me for it, so probably someone might need a jumpstart in unit tests.</p>
<p>Here&#8217;s a short list of short (though very deep, if not best) intros.</p>
<ul>
<li>Except for <a href="http://junit.sourceforge.net/doc/cookbook/cookbook.htm">JUnit cookbook</a> (~2 pages) (which has a lot of &#8220;ports&#8221;, like <a href="http://cppunit.sourceforge.net/doc/1.8.0/cppunit_cookbook.html">CppUnit cookbook</a>), I&#8217;d name:</li>
<li>&#8220;<a href="http://www.mockobjects.com/files/endotesting.pdf">Endo-Testing: Unit Testing with Mock Objects</a>&#8221; at mockobjects.com (Tim Mackinnon, Steve Freeman, Philip Craig) (7 pages);</li>
<li><a href="http://martinfowler.com/articles/mocksArentStubs.html">&#8220;Mocks aren&#8217;t stubs&#8221;</a> by Martin Fowler (about 7 pages);</li>
</ul>
<p>For deeper dive, take a &#8220;<a href="http://xunitpatterns.com/">xUnit patterns</a>&#8221; book (this one is longer).</p>
<p>For <a href="http://en.wikipedia.org/wiki/Kent_Beck">Kent Beck</a>&#8216;s <a rel="nofollow" href="http://en.wikipedia.org/wiki/Special:BookSources/0201616416">book on TDD</a>, shame on me &#8211; I never read it. Though after &#8220;XP explained&#8221; I don&#8217;t strive for reading his books.</p>
<p>// If you&#8217;re interested in XP and &#8220;XP explained&#8221; criticism, take a look at <a href="http://www.agilealliance.com/show/945">&#8220;Extreme Programming Considered Harmful for Reliable Software Development&#8221;</a> by Gerald Keefer.</p>
<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:70px;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fvictorsergienko.com%2Funit-tests-quickstart%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe></div><div class="really_simple_share_google1" style="width:60px;"><div class="g-plusone" data-size="medium" data-href="http://victorsergienko.com/unit-tests-quickstart/" data-annotation="none"></div></div><div class="really_simple_share_twitter" style="width:70px;"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none" 
						data-text="Unit tests quickstart" data-url="http://victorsergienko.com/unit-tests-quickstart/" 
						data-via=""  ></a></div></div>
		<div style="clear:both;"></div>]]></content:encoded>
			<wfw:commentRss>http://victorsergienko.com/unit-tests-quickstart/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On unit tests in Visual Studio 2008 vs NUnit</title>
		<link>http://victorsergienko.com/on-unit-tests-in-visual-studio-2008-vs-nunit/</link>
		<comments>http://victorsergienko.com/on-unit-tests-in-visual-studio-2008-vs-nunit/#comments</comments>
		<pubDate>Mon, 02 Jun 2008 12:31:46 +0000</pubDate>
		<dc:creator>Victor Sergienko</dc:creator>
				<category><![CDATA[Main]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://victorsergienko.com/?p=44</guid>
		<description><![CDATA[Comparison of Microsoft Visual Studio unit tests (MSTest) vs NUnit, mentioning PartCover and ]]></description>
			<content:encoded><![CDATA[<p>My not-so-humble evaluation of VS tests distinctions from NUnit is (in points on -10 to 10 scale).</p>
<ul>
<li>(-4) To run tests, VS launches an <strong>entire process</strong> which takes no less then 3 seconds to start. If you&#8217;re in &#8220;F5 hit breakpoint &#8211; Shift-F5&#8243; loop, that&#8217;s disgusting. <em>NUnit tests can be run in-process by Resharper or TestDriver.NET</em>;</li>
<li>(-2) GUI that shows where test failed is ugly. You don&#8217;t get to failed line on double-click, you first get to test log page. Status and call stack are necessary, but I&#8217;d like not to <strong>trash my document tabs</strong>, I already have enough of them open. You can&#8217;t make that kind of windows docked/floating;</li>
<li> (-1) You got a &#8220;<code>public TestContext TestContext;</code>&#8221; sticking in your code. You&#8217;ll need it only when it comes to <a href="http://msdn.microsoft.com/en-us/library/ms379625(VS.80).aspx#vstsunittesting_topic6">testing on data</a>, which doesn&#8217;t always happen, even in a data-driven application;</li>
<li>(-1) It&#8217;s a &#8220;<a href="http://en.wikipedia.org/wiki/Not_Invented_Here">not invented here</a>&#8221; technology, while <strong>NUnit</strong> was around for years;</li>
</ul>
<p>Edit: In a moment of madness, I mixed together coverage profiling and unit testing tools. May God and readers forgive my aberration.</p>
<p>Edit2: If you need a half-page <a href="http://victorsergienko.com/unit-tests-quickstart/">kickstart in unit testing</a> techniques, the next post can help.</p>
<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:70px;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fvictorsergienko.com%2Fon-unit-tests-in-visual-studio-2008-vs-nunit%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe></div><div class="really_simple_share_google1" style="width:60px;"><div class="g-plusone" data-size="medium" data-href="http://victorsergienko.com/on-unit-tests-in-visual-studio-2008-vs-nunit/" data-annotation="none"></div></div><div class="really_simple_share_twitter" style="width:70px;"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none" 
						data-text="On unit tests in Visual Studio 2008 vs NUnit" data-url="http://victorsergienko.com/on-unit-tests-in-visual-studio-2008-vs-nunit/" 
						data-via=""  ></a></div></div>
		<div style="clear:both;"></div>]]></content:encoded>
			<wfw:commentRss>http://victorsergienko.com/on-unit-tests-in-visual-studio-2008-vs-nunit/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Please meet: Lua</title>
		<link>http://victorsergienko.com/please-meet-lua/</link>
		<comments>http://victorsergienko.com/please-meet-lua/#comments</comments>
		<pubDate>Thu, 15 May 2008 10:00:08 +0000</pubDate>
		<dc:creator>Victor Sergienko</dc:creator>
				<category><![CDATA[Main]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Lua]]></category>

		<guid isPermaLink="false">http://victorsergienko.com/?p=41</guid>
		<description><![CDATA[Lua language brief description, and the best Lua book in CHM.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.lua.org/">Lua</a> recently became very popular. I encountered Lua scripting in several applications including popular games, I believe it&#8217;s used in even more then <a href="http://en.wikipedia.org/wiki/Lua_(programming_language)#Applications">Wikipedia says</a>.</p>
<p>It&#8217;s extremely simple:</p>
<ul>
<li>6 data types (that&#8217;s counting &#8220;nul&#8221; and &#8220;function&#8221;),</li>
<li>no C++-style OOP out-of-box (but you can program one, he-he),</li>
<li>400K of pure-C code</li>
</ul>
<p>but is loaded with in-fashion features like</p>
<ul>
<li>first-class functions,</li>
<li>closures,</li>
<li><a title="Coroutine" href="http://en.wikipedia.org/wiki/Coroutine">coroutines</a>&#8230;</li>
<li>again, <a href="http://en.wikipedia.org/wiki/Lua_(programming_language)#Features">Wikipedia</a> is the best.</li>
</ul>
<p>The only metaprogramming tutorial (with a ready code to implement virtual methods) is <a href="http://www.lua.org/pil/">&#8220;Programming in Lua&#8221; book</a>. <i>Still, I don&#8217;t see a code to implement <a href="http://en.wikipedia.org/wiki/Parametric_polymorphism#Ad-hoc_polymorphism">ad-hoc polymorphism</a>&#8230; Maybe it&#8217;s a reason for another post <img src='http://victorsergienko.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </i></p>
<p><i>Redistributed book removed: it violated copyright</i>.</p>
<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:70px;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fvictorsergienko.com%2Fplease-meet-lua%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe></div><div class="really_simple_share_google1" style="width:60px;"><div class="g-plusone" data-size="medium" data-href="http://victorsergienko.com/please-meet-lua/" data-annotation="none"></div></div><div class="really_simple_share_twitter" style="width:70px;"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none" 
						data-text="Please meet: Lua" data-url="http://victorsergienko.com/please-meet-lua/" 
						data-via=""  ></a></div></div>
		<div style="clear:both;"></div>]]></content:encoded>
			<wfw:commentRss>http://victorsergienko.com/please-meet-lua/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Another C++ quiz, simpler</title>
		<link>http://victorsergienko.com/cpp-quiz-simpler/</link>
		<comments>http://victorsergienko.com/cpp-quiz-simpler/#comments</comments>
		<pubDate>Tue, 13 May 2008 22:46:57 +0000</pubDate>
		<dc:creator>Victor Sergienko</dc:creator>
				<category><![CDATA[Main]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[quiz]]></category>

		<guid isPermaLink="false">http://victorsergienko.com/?p=40</guid>
		<description><![CDATA[Simple C++ quiz about class member pointer.]]></description>
			<content:encoded><![CDATA[<p>Did you ever think, what happens if you take a member pointer to a virtual function of a class, and then call it on <strong>another</strong> instance of derived class (that overrides that member)?</p>
<p>What if you do the same for <strong>nonvirtual</strong> function?</p>
<p>Here&#8217;s a test:</p>
<pre><tt><strong><span style="color: #000080;">#include</span></strong> <span style="color: #ff0000;">&lt;iostream&gt;</span>

<strong><span style="color: #0000ff;">class</span></strong> A
<span style="color: #ff0000;">{</span>
</tt><tt><strong><span><tt><strong><span style="color: #0000ff;">  </span></strong></tt></span></strong></tt><tt><strong><span style="color: #0000ff;">public</span></strong><span style="color: #990000;">:</span>
</tt><tt><strong><span><tt><strong><span style="color: #0000ff;">  </span></strong></tt></span></strong></tt><tt><strong><span style="color: #0000ff;">virtual</span></strong> <span style="color: #009900;">void</span> <strong><span style="color: #000000;">f</span></strong><span style="color: #990000;">(</span><span style="color: #990000;">)</span> <span style="color: #ff0000;">{</span> std<span style="color: #990000;">:</span><span style="color: #990000;">:</span>cout <span style="color: #990000;">&lt;</span><span style="color: #990000;">&lt;</span> <span style="color: #ff0000;">"A::f()\n"</span><span style="color: #990000;">;</span> <span style="color: #ff0000;">}</span><span style="color: #990000;">;</span>
</tt><tt><strong><span><tt><strong><span style="color: #0000ff;">  </span></strong></tt></span></strong></tt><tt><span style="color: #009900;">void</span> <strong><span style="color: #000000;">g</span></strong><span style="color: #990000;">(</span><span style="color: #990000;">)</span> <span style="color: #ff0000;">{</span> std<span style="color: #990000;">:</span><span style="color: #990000;">:</span>cout <span style="color: #990000;">&lt;</span><span style="color: #990000;">&lt;</span> <span style="color: #ff0000;">"A::g()\n"</span><span style="color: #990000;">;</span> <span style="color: #ff0000;">}</span><span style="color: #990000;">;</span>
<span style="color: #ff0000;">}</span><span style="color: #990000;">;</span>

<strong><span style="color: #0000ff;">class</span></strong> B <span style="color: #990000;">:</span> <strong><span style="color: #0000ff;">public</span></strong> A
<span style="color: #ff0000;">{</span>
<strong><span style="color: #0000ff;">  public</span></strong><span style="color: #990000;">:</span>
</tt><tt><strong><span><tt><strong><span style="color: #0000ff;">  </span></strong></tt></span></strong></tt><tt><strong><span style="color: #0000ff;">virtual</span></strong> <span style="color: #009900;">void</span> <strong><span style="color: #000000;">f</span></strong><span style="color: #990000;">(</span><span style="color: #990000;">)</span> <span style="color: #ff0000;">{</span> std<span style="color: #990000;">:</span><span style="color: #990000;">:</span>cout <span style="color: #990000;">&lt;</span><span style="color: #990000;">&lt;</span> <span style="color: #ff0000;">"B::f()\n"</span><span style="color: #990000;">;</span> <span style="color: #ff0000;">}</span><span style="color: #990000;">;</span>
</tt><tt><strong><span><tt><strong><span style="color: #0000ff;">  </span></strong></tt></span></strong></tt><tt><span style="color: #009900;">void</span> <strong><span style="color: #000000;">g</span></strong><span style="color: #990000;">(</span><span style="color: #990000;">)</span> <span style="color: #ff0000;">{</span> std<span style="color: #990000;">:</span><span style="color: #990000;">:</span>cout <span style="color: #990000;">&lt;</span><span style="color: #990000;">&lt;</span> <span style="color: #ff0000;">"B::g()\n"</span><span style="color: #990000;">;</span> <span style="color: #ff0000;">}</span><span style="color: #990000;">;</span>
<span style="color: #ff0000;">}</span><span style="color: #990000;">;</span>

<strong><span style="color: #0000ff;">typedef</span></strong> <span style="color: #009900;">void</span> <span style="color: #990000;">(</span>A<span style="color: #990000;">:</span><span style="color: #990000;">:</span><span style="color: #990000;">*</span>VirtualFunctionPointer<span style="color: #990000;">)</span> <span style="color: #990000;">(</span><span style="color: #990000;">)</span><span style="color: #990000;">;</span>

<span style="color: #009900;">int</span> <strong><span style="color: #000000;">main</span></strong><span style="color: #990000;">(</span><span style="color: #990000;">)</span>
<span style="color: #ff0000;">{</span>
</tt><tt><strong><span><tt><strong><span style="color: #0000ff;">  </span></strong></tt></span></strong></tt><tt>A a<span style="color: #990000;">;</span>
</tt><tt><strong><span><tt><strong><span style="color: #0000ff;">  </span></strong></tt></span></strong></tt><tt>B b<span style="color: #990000;">;</span>
</tt><tt><strong><span><tt><strong><span style="color: #0000ff;">  </span></strong></tt></span></strong></tt><tt>B<span style="color: #990000;">*</span> pb <span style="color: #990000;">=</span> <span style="color: #990000;">&amp;</span>b<span style="color: #990000;">;</span>

</tt><tt><strong><span><tt><strong><span style="color: #0000ff;">  </span></strong></tt></span></strong></tt><tt>VirtualFunctionPointer p <span style="color: #990000;">=</span> <span style="color: #990000;">&amp;</span>A<span style="color: #990000;">:</span><span style="color: #990000;">:</span>f<span style="color: #990000;">;</span>
</tt><tt><strong><span><tt><strong><span style="color: #0000ff;">  </span></strong></tt></span></strong></tt><tt><span style="color: #990000;">(</span>pb<span style="color: #990000;">-</span><span style="color: #990000;">&gt;</span><span style="color: #990000;">*</span>p<span style="color: #990000;">)</span> <span style="color: #990000;">(</span><span style="color: #990000;">)</span><span style="color: #990000;">;</span>

</tt><tt><strong><span><tt><strong><span style="color: #0000ff;">  </span></strong></tt></span></strong></tt><tt>p <span style="color: #990000;">=</span> <span style="color: #990000;">&amp;</span>A<span style="color: #990000;">:</span><span style="color: #990000;">:</span>g<span style="color: #990000;">;</span>
</tt><tt><strong><span><tt><strong><span style="color: #0000ff;">  </span></strong></tt></span></strong></tt><tt><span style="color: #990000;">(</span>pb<span style="color: #990000;">-</span><span style="color: #990000;">&gt;</span><span style="color: #990000;">*</span>p<span style="color: #990000;">)</span> <span style="color: #990000;">(</span><span style="color: #990000;">)</span><span style="color: #990000;">;</span>
</tt><tt><strong><span><tt><strong><span style="color: #0000ff;">  </span></strong></tt></span></strong></tt><tt><strong><span style="color: #0000ff;">return</span></strong> <span style="color: #993399;">0</span><span style="color: #990000;">;</span>
<span style="color: #ff0000;">}</span>
</tt></pre>
<p>Answer is in comments.</p>
<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:70px;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fvictorsergienko.com%2Fcpp-quiz-simpler%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe></div><div class="really_simple_share_google1" style="width:60px;"><div class="g-plusone" data-size="medium" data-href="http://victorsergienko.com/cpp-quiz-simpler/" data-annotation="none"></div></div><div class="really_simple_share_twitter" style="width:70px;"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none" 
						data-text="Another C++ quiz, simpler" data-url="http://victorsergienko.com/cpp-quiz-simpler/" 
						data-via=""  ></a></div></div>
		<div style="clear:both;"></div>]]></content:encoded>
			<wfw:commentRss>http://victorsergienko.com/cpp-quiz-simpler/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>C++ quiz from the past</title>
		<link>http://victorsergienko.com/cpp-quiz/</link>
		<comments>http://victorsergienko.com/cpp-quiz/#comments</comments>
		<pubDate>Tue, 13 May 2008 22:40:19 +0000</pubDate>
		<dc:creator>Victor Sergienko</dc:creator>
				<category><![CDATA[Main]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[quiz]]></category>

		<guid isPermaLink="false">http://victorsergienko.com/?p=39</guid>
		<description><![CDATA[C++ quiz about streams, dynamic_cast, temporary values, default type conversions and more...]]></description>
			<content:encoded><![CDATA[<p>One of my friends once encountered a C++ compilation issue.<br />
A program is given:</p>
<pre><tt><strong><span style="color: #000080;">#include</span></strong> <span style="color: #ff0000;">&lt;iostream&gt;</span>
<strong><span style="color: #000080;">#include</span></strong> <span style="color: #ff0000;">&lt;sstream&gt;</span>
<strong><span style="color: #0000ff;">using</span></strong> <strong><span style="color: #0000ff;">namespace</span></strong> std<span style="color: #990000;">;</span>

<strong><span style="color: #000080;">#define</span></strong> <strong><span style="color: #000000;">SFORMAT</span></strong><span style="color: #990000;">(</span>e<span style="color: #990000;">)</span> <span style="color: #990000;">(</span><span style="color: #990000;">(</span><strong><span style="color: #0000ff;">dynamic_cast</span></strong><span style="color: #990000;">&lt;</span><strong><span style="color: #0000ff;">const</span></strong> ostringstream<span style="color: #990000;">&amp;</span><span style="color: #990000;">&gt;</span><span style="color: #990000;">(</span><strong><span style="color: #000000;">ostringstream</span></strong><span style="color: #990000;">(</span><span style="color: #990000;">)</span> <span style="color: #990000;">&lt;</span><span style="color: #990000;">&lt;</span> e<span style="color: #990000;">)</span><span style="color: #990000;">)</span><span style="color: #990000;">.</span><strong><span style="color: #000000;">str</span></strong><span style="color: #990000;">(</span><span style="color: #990000;">)</span><span style="color: #990000;">)</span>

<span style="color: #009900;">int</span> <strong><span style="color: #000000;">main</span></strong><span style="color: #990000;">(</span><span style="color: #009900;">int</span> argc<span style="color: #990000;">,</span> <span style="color: #009900;">char</span><span style="color: #990000;">*</span> argv<span style="color: #990000;">[</span><span style="color: #990000;">]</span><span style="color: #990000;">)</span>
<span style="color: #ff0000;">{</span>
cout <span style="color: #990000;">&lt;</span><span style="color: #990000;">&lt;</span> <strong><span style="color: #000000;">SFORMAT</span></strong><span style="color: #990000;">(</span><span style="color: #ff0000;">"2 x "</span> <span style="color: #990000;">&lt;</span><span style="color: #990000;">&lt;</span> <span style="color: #ff0000;">" 2 = "</span> <span style="color: #990000;">&lt;</span><span style="color: #990000;">&lt;</span> <span style="color: #993399;">2</span><span style="color: #990000;">*</span><span style="color: #993399;">2</span><span style="color: #990000;">)</span><span style="color: #990000;">;</span>
<strong><span style="color: #0000ff;">return</span></strong> <span style="color: #993399;">0</span><span style="color: #990000;">;</span>
<span style="color: #ff0000;">}</span></tt></pre>
<p>No one asks you what it will print, unless you&#8217;re a god.</p>
<p>Question is: why is the first const char* printed as a pointer, instead of what we need?<br />
Two years ago, I couldn&#8217;t tell.<br />
Some guru from Apple answered this in a newsgroup.</p>
<p>Here, take another, simpler <a href="http://victorsergienko.com/cpp-quiz-simpler/">C++ quiz about member pointers</a>.</p>
<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:70px;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fvictorsergienko.com%2Fcpp-quiz%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe></div><div class="really_simple_share_google1" style="width:60px;"><div class="g-plusone" data-size="medium" data-href="http://victorsergienko.com/cpp-quiz/" data-annotation="none"></div></div><div class="really_simple_share_twitter" style="width:70px;"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none" 
						data-text="C++ quiz from the past" data-url="http://victorsergienko.com/cpp-quiz/" 
						data-via=""  ></a></div></div>
		<div style="clear:both;"></div>]]></content:encoded>
			<wfw:commentRss>http://victorsergienko.com/cpp-quiz/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MSBuild don&#8217;ts</title>
		<link>http://victorsergienko.com/msbuild-tips-1/</link>
		<comments>http://victorsergienko.com/msbuild-tips-1/#comments</comments>
		<pubDate>Tue, 15 Apr 2008 12:15:45 +0000</pubDate>
		<dc:creator>Victor Sergienko</dc:creator>
				<category><![CDATA[Main]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[MSBuild]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://victorsergienko.com/?p=31</guid>
		<description><![CDATA[MSBuild tips: some things you shouldn't do, and what to do instead.]]></description>
			<content:encoded><![CDATA[<p>A couple of notes how NOT to use MSBuild.</p>
<ol>
<li>Don&#8217;t generate files with <strong>AssemblyInfo task</strong>. It screws comments, screws <em><strong>InternalsVisibleTo</strong></em> attributes, and whatever else it doesn&#8217;t account for.<strong><br />
Instead</strong>: Use<br />
<code>&lt;FileUpdate Files="@(AssemblyInfoFiles)"<br />
Regex="AssemblyVersion\(".*?"\)\]"<br />
ReplacementText="AssemblyVersion("$(Major).$(Minor).$(Build).$(Revision)")]"<br />
/&gt;<br />
&lt;FileUpdate Files="@(AssemblyInfoFiles)"<br />
Regex="AssemblyFileVersion\(".*?"\)\]"<br />
ReplacementText="AssemblyFileVersion("$(Major).$(Minor).$(Build).$(Revision)")]"<br />
/&gt;</code></li>
<li>Don&#8217;t account for <strong>TfsXXXX community tasks</strong> &#8211; it won&#8217;t run on VS 2008 with Team Explorer 9.0.<br />
<strong>Instead</strong>:  Use &lt;Exec Command=&#8221;tf &#8230;&#8221;&gt;.<br />
And if you have domain authentication in TFS and don&#8217;t run integration under domain user (which happens), you even can&#8217;t run tf in cmd-line mode: stupid authentication dialog will pop up.</li>
<li>Do not use <strong>local files to store version number</strong>. You will lose them when moving build to another host, so use only source control-dependent files.<br />
Might seem evident, but strange how many people miss this.<br />
So you&#8217;ll need to<br />
<code>&lt;Attrib Files="version.txt" Normal="true" /&gt;</code></li>
<li>Per <a href="http://www.traceofthought.net/2008/01/02/CustomizingTFSTeamBuildBuildNumbers.aspx">Scott Colestock&#8217;s post</a>, <i>&#8220;since <strong>TfsVersion</strong> interrogates the build server&#8217;s workspace, and BuildNumberOverrideTarget comes early in the process&#8230; you might find that you don&#8217;t get the changeset number you expect&#8221;.</i></li>
<li>Don&#8217;t try to operate on <strong>XML node collections</strong> with tasks other then <strong>Xslt</strong>.<br />
For instance, XmlRead returns a Nodeset only as a string of &#8220;;&#8221;-joined<br />
Node.Value-s.<br />
<strong>XmlQuery</strong> supports <strong>Values</strong> property, though I wasn&#8217;t able to operate it&#8217;s results.<br />
Instead you can use ReadLinesFromFile (sadly, this will trim the lines).<br />
My personal choice for not-too-complex XML is&#8230; you can guess&#8230; yes, <strong>FileUpdate</strong>.</li>
<li>Don&#8217;t use <strong>FtpUpload</strong>. It won&#8217;t create folders for you.<br />
Just &lt;Exec&gt; a ftp&#8230;<br />
By the way, Windows&#8217; ftp.exe client is unable to upload in passive mode. You can download passively, if you issue &#8220;<strong>LITERAL PASV</strong>&#8220;, but it won&#8217;t help the client.</li>
</ol>
<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:70px;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fvictorsergienko.com%2Fmsbuild-tips-1%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe></div><div class="really_simple_share_google1" style="width:60px;"><div class="g-plusone" data-size="medium" data-href="http://victorsergienko.com/msbuild-tips-1/" data-annotation="none"></div></div><div class="really_simple_share_twitter" style="width:70px;"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none" 
						data-text="MSBuild don&#8217;ts" data-url="http://victorsergienko.com/msbuild-tips-1/" 
						data-via=""  ></a></div></div>
		<div style="clear:both;"></div>]]></content:encoded>
			<wfw:commentRss>http://victorsergienko.com/msbuild-tips-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bootstrapper also can&#8217;t install your application after rebooting&#8230;</title>
		<link>http://victorsergienko.com/bootstrapper-also-cant-install-your-application-after-rebooting/</link>
		<comments>http://victorsergienko.com/bootstrapper-also-cant-install-your-application-after-rebooting/#comments</comments>
		<pubDate>Fri, 04 Apr 2008 19:17:09 +0000</pubDate>
		<dc:creator>Victor Sergienko</dc:creator>
				<category><![CDATA[Main]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[MSBuild]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://victorsergienko.com/?p=34</guid>
		<description><![CDATA[Another problem with MSBuild bootstrappers that can screw all your installation&#8230; If scheduling reboot after installing .NET or other prerequisites, bootstrapper copies itself to run from TEMP on boot. Why not staying where it is &#8211; who knows. And definitely, all the other MSIs are not copied, so it won&#8217;t find them. Reproduced for me. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Another <a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=112820">problem with MSBuild bootstrappers</a> that can screw all your installation</strong>&#8230;</p>
<p>If scheduling reboot after installing .NET or other prerequisites, bootstrapper copies itself to run from TEMP on boot. Why not staying where it is &#8211; who knows. And definitely, all the other MSIs are not copied, so it won&#8217;t find them. Reproduced for me.</p>
<p>Now give up and go write own bootstrapper. I&#8217;m setiously considering going for <a href="http://www.blackhillsoftware.com/blog/2006/06/26/using-innosetup-with-the-dotnet-framework/">InnoSetup deployment</a>.</p>
<p>For now, I&#8217;m trying a crazy ting, to copy MSI to TEMP for Setup.exe to find it after reincarnation&#8230; It&#8217;s the way to use given tools.</p>
<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:70px;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fvictorsergienko.com%2Fbootstrapper-also-cant-install-your-application-after-rebooting%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe></div><div class="really_simple_share_google1" style="width:60px;"><div class="g-plusone" data-size="medium" data-href="http://victorsergienko.com/bootstrapper-also-cant-install-your-application-after-rebooting/" data-annotation="none"></div></div><div class="really_simple_share_twitter" style="width:70px;"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none" 
						data-text="Bootstrapper also can&#8217;t install your application after rebooting&#8230;" data-url="http://victorsergienko.com/bootstrapper-also-cant-install-your-application-after-rebooting/" 
						data-via=""  ></a></div></div>
		<div style="clear:both;"></div>]]></content:encoded>
			<wfw:commentRss>http://victorsergienko.com/bootstrapper-also-cant-install-your-application-after-rebooting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Can&#8217;t run .NET bootstrapper from an MSI</title>
		<link>http://victorsergienko.com/dotnet-bootstrapper-from-msiexec/</link>
		<comments>http://victorsergienko.com/dotnet-bootstrapper-from-msiexec/#comments</comments>
		<pubDate>Wed, 02 Apr 2008 15:56:22 +0000</pubDate>
		<dc:creator>Victor Sergienko</dc:creator>
				<category><![CDATA[Main]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[MSBuild]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://victorsergienko.com/?p=33</guid>
		<description><![CDATA[Now I know it. It&#8217;s Windows Installer error 1618 that I didn&#8217;t see somewhy when attempting to fix .NET bootstrapper. Either I was inattentive or it wasn&#8217;t there: &#8220;Another copy of msiexec is running&#8221;. You can&#8217;t have two Windows Installers running, at least if one of them installs .NET. Information is from this maillist post. [...]]]></description>
			<content:encoded><![CDATA[<p>Now I know it.</p>
<p>It&#8217;s Windows Installer error 1618 that I didn&#8217;t see somewhy when attempting to fix .NET bootstrapper. Either I was inattentive or it wasn&#8217;t there: &#8220;Another copy of msiexec is running&#8221;. <strong>You can&#8217;t have two Windows Installers running</strong>, at least if one of them installs .NET. Information is from this <a href="http://www.eggheadcafe.com/software/aspnet/31744087/launching-child-installer.aspx">maillist post</a>.</p>
<p>Why? Implementation limitations, I believe. No sane reasons for such a contract, no article mentioned this. Surely, who&#8217;s going to declare own &#8220;features&#8221; of that kind &#8211; just a gentle hints that &#8220;you should better use bootstrapper&#8221;. Another reason to long for a systems where setup is just a copy.</p>
<p>So go pack a MSI, then make a MSBuild bootstrapper.</p>
<p><strong>Oh wait, do I have to have 2 files in my installation?</strong> And my customers can&#8217;t download one file?</p>
<p>Yes. Or go for <a href="http://www.winzip.com/xsepedif.htm">WinZip Self-Extractor</a>, or <a href="http://www.rarlab.com/download.htm">WinRar</a>, or whatever else.</p>
<p><strong>What about build scripts?</strong> For WinRar, here&#8217;s a <a href="http://dotnet.dzone.com/news/use-nant-and-winrar-create-sel">nice sample</a>. For WinZip sfx, there&#8217;s also a command-line interface. Do a</p>
<p><code>wzipse32 %ARC_NAME% -setup -auto -runasuser -le -i ../icon.ico -wait msiexec -c ".\setup.exe"</code></p>
<p>WinZip will do the thing, though displaying some dialogs we don&#8217;t need at all.</p>
<p>Oh, <strong>WinRar won&#8217;t work</strong>, because it erases temporary files upon setup.exe completion. And we need to wait for msiexec, because setup.exe exits earlier. What a pity.</p>
<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:70px;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fvictorsergienko.com%2Fdotnet-bootstrapper-from-msiexec%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe></div><div class="really_simple_share_google1" style="width:60px;"><div class="g-plusone" data-size="medium" data-href="http://victorsergienko.com/dotnet-bootstrapper-from-msiexec/" data-annotation="none"></div></div><div class="really_simple_share_twitter" style="width:70px;"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none" 
						data-text="Can&#8217;t run .NET bootstrapper from an MSI" data-url="http://victorsergienko.com/dotnet-bootstrapper-from-msiexec/" 
						data-via=""  ></a></div></div>
		<div style="clear:both;"></div>]]></content:encoded>
			<wfw:commentRss>http://victorsergienko.com/dotnet-bootstrapper-from-msiexec/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MSBuild bootstrapper for .NET 3.0 broken?</title>
		<link>http://victorsergienko.com/msbuild-bootstrapper-for-net-30-framework-broken/</link>
		<comments>http://victorsergienko.com/msbuild-bootstrapper-for-net-30-framework-broken/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 18:45:52 +0000</pubDate>
		<dc:creator>Victor Sergienko</dc:creator>
				<category><![CDATA[Main]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[MSBuild]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://victorsergienko.com/msbuild-bootstrapper-for-net-30-framework-broken/</guid>
		<description><![CDATA[After Microsoft didn&#8217;t include .NET 3.5 in any current release of Windows (read &#8220;Vista service pack 1&#8243;), some of us developers who believed in long-ago C# 3.0 ads, had to roll back to .NET 3.0 and C# 2.0. Including me. Not mentioning pain of rolling back all LINQ tasties in code and debugging our replacements [...]]]></description>
			<content:encoded><![CDATA[<p>After Microsoft didn&#8217;t include .NET 3.5 in any current release of Windows (read &#8220;Vista service pack 1&#8243;), some of us developers who believed in long-ago C# 3.0 ads, had to roll back to .NET 3.0 and C# 2.0.</p>
<p>Including me.</p>
<p>Not mentioning pain of rolling back all LINQ tasties in code and debugging our replacements (do you know why you can&#8217;t implement Where() just with <strong>yield</strong>-style function?), it means installing .NET 3.0.</p>
<p>It seemed to be not a problem, having a MSBuild code snippet that worked for 3.5 &#8211; just replace 3.5 with 3.0:</p>
<p><code> </code></p>
<pre>&lt;ItemGroup&gt;
&lt;BootstrapperFile Include="Microsoft.Net.Framework.3.0"&gt;
&lt;ProductName&gt;.NET Framework 3.0&lt;/ProductName&gt;
&lt;/BootstrapperFile&gt;
&lt;BootstrapperFile Include="Microsoft.Windows.Installer.3.1"&gt;
&lt;ProductName&gt;Windows Installer 3.1&lt;/ProductName&gt;
&lt;/BootstrapperFile&gt;

&lt;Target Name="Bootstrapper"&gt;
&lt;GenerateBootstrapper
ApplicationName="blah blah blah blah"
BootstrapperItems="@(BootstrapperFile)"
BootstrapperKeyFile=""
OutputPath="obj"
ComponentsLocation="HomeSite" CopyComponents="false"
SupportUrl="http://www.microsoft.com/downloads/details.aspx?familyid=10CC340B-F857-4A14-83F5-25634C3BF043"
Culture="en" Path="$(BootstrapperPath)"/&gt;
&lt;/Target&gt;</pre>
<p><strong>Won&#8217;t work</strong>.</p>
<p>Hell why? Who knows. Logs in temp don&#8217;t give proper diagnostics, nor system events do. WPF fails to install at some point onto every XP installations we have, including clean <strong>special test XP SP2 VMWare images downloaded from Microsoft</strong>.</p>
<p><strong>Update</strong>: <a href="http://victorsergienko.com/dotnet-bootstrapper-from-msiexec/">Here&#8217;s the answer</a>.</p>
<p>Now I rolled back to dotnetfx3setup.exe redistributable. It&#8217;s 2.8M compared to 300K bootstrapper generated by MSBuild, and it&#8217;s a pain to see installer grow&#8230;And if .NET 3.0 is already installed it starts to uninstall it&#8230; and there is no key to make it just &#8220;check or install&#8221;, need to trick it via WiX.</p>
<p>But we have to pay it. Oh my.</p>
<p>All over the Web I see no evidence that any man walked this path before. For.NET 2.0 &#8211; a lot of mentions and code samples. And completely empty for .NET 3.0.</p>
<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:70px;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fvictorsergienko.com%2Fmsbuild-bootstrapper-for-net-30-framework-broken%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe></div><div class="really_simple_share_google1" style="width:60px;"><div class="g-plusone" data-size="medium" data-href="http://victorsergienko.com/msbuild-bootstrapper-for-net-30-framework-broken/" data-annotation="none"></div></div><div class="really_simple_share_twitter" style="width:70px;"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none" 
						data-text="MSBuild bootstrapper for .NET 3.0 broken?" data-url="http://victorsergienko.com/msbuild-bootstrapper-for-net-30-framework-broken/" 
						data-via=""  ></a></div></div>
		<div style="clear:both;"></div>]]></content:encoded>
			<wfw:commentRss>http://victorsergienko.com/msbuild-bootstrapper-for-net-30-framework-broken/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>C++ static code checker</title>
		<link>http://victorsergienko.com/cpp-static-code-checker-2/</link>
		<comments>http://victorsergienko.com/cpp-static-code-checker-2/#comments</comments>
		<pubDate>Wed, 26 Mar 2008 08:31:24 +0000</pubDate>
		<dc:creator>Victor Sergienko</dc:creator>
				<category><![CDATA[Main]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://victorsergienko.com/cpp-static-code-checker-2/</guid>
		<description><![CDATA[Did you ever try parsing C++? What about parsing for every combination of possible define-s at once? Microsoft has a static code checker tools for C++, like FxCop for .NET. That&#8217;s awfully complex task, you now see. In .NET you can analyze bytecode, and luckily don&#8217;t really need to account for conditional compilation. In C++ [...]]]></description>
			<content:encoded><![CDATA[<p>Did you ever try parsing C++? What about parsing for every combination of possible <em>define</em>-s at once?</p>
<p>Microsoft has a <a href="http://www.microsoft.com/windows/cse/pa_projects.mspx">static code checker tools for C++</a>, like FxCop for .NET.</p>
<p>That&#8217;s awfully complex task, you now see. In .NET you can analyze bytecode, and luckily don&#8217;t really need to account for conditional compilation. In C++ where everthing is about <em>#ifdef</em> &#8211; it&#8217;s hell.</p>
<p>I never heared of anything like that. Though <a href="http://www.parasoft.com/jsp/products/home.jsp?product=Insure">Insure++</a> or <a href="http://automatedqa.com/products/aqtime/">AQTime</a> do way more things when profiling runtime, they of course find only things that were on necessary execution paths.</p>
<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:70px;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fvictorsergienko.com%2Fcpp-static-code-checker-2%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe></div><div class="really_simple_share_google1" style="width:60px;"><div class="g-plusone" data-size="medium" data-href="http://victorsergienko.com/cpp-static-code-checker-2/" data-annotation="none"></div></div><div class="really_simple_share_twitter" style="width:70px;"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none" 
						data-text="C++ static code checker" data-url="http://victorsergienko.com/cpp-static-code-checker-2/" 
						data-via=""  ></a></div></div>
		<div style="clear:both;"></div>]]></content:encoded>
			<wfw:commentRss>http://victorsergienko.com/cpp-static-code-checker-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WiX linkdump: samples and howto-s I found, mostly .NET deployment</title>
		<link>http://victorsergienko.com/wix-net-linkdump-samples-howto-s/</link>
		<comments>http://victorsergienko.com/wix-net-linkdump-samples-howto-s/#comments</comments>
		<pubDate>Thu, 20 Mar 2008 23:38:44 +0000</pubDate>
		<dc:creator>Victor Sergienko</dc:creator>
				<category><![CDATA[Main]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[WiX]]></category>

		<guid isPermaLink="false">http://victorsergienko.com/wix-net-linkdump-samples-howto-s/</guid>
		<description><![CDATA[Some pages that somewhy didn&#8217;t appear at top of Google searches for WiX help. WiXWiki.com &#8211; pretty useful and contains some snippets you won&#8217;t find in WiX manual or tutorial. Many of rare code snippets WiX development releases; some broken (last two broken in VS 2008), some contain the very things you&#8217;ll need; Justin Rockwood&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Some pages that somewhy didn&#8217;t appear at top of Google searches for <a href="http://wix.sourceforge.net/">WiX</a> help.</p>
<ul>
<li><a href="http://www.wixwiki.com/">WiXWiki.com</a> &#8211; pretty useful and contains some snippets you won&#8217;t find in WiX manual or tutorial. <em>Many of rare code snippets</em></li>
<li><a href="http://wix.sourceforge.net/releases/">WiX development releases</a>; some broken (last two broken in VS 2008), some contain the very things you&#8217;ll need;</li>
<li>Justin Rockwood&#8217;s blog entry <a href="http://blogs.msdn.com/jrock/archive/2008/01/29/complete-list-of-candle-preprocessor-variables.aspx">with Votive (Visual Studio addon) preprocessor variables</a>. The blog itself is also thing to read;</li>
<li>Alex Shevcuk&#8217;s blog entry on <a href="http://blogs.technet.com/alexshev/archive/2008/02/10/from-msi-to-wix-part-3.aspx">checking pre- and postconditions in WiX</a>. <em>His whole <a href="http://blogs.technet.com/alexshev/archive/tags/WiX/default.aspx">cycle on WiX</a> &#8211; I also highly recommend it</em>;</li>
<li>Separately, <strong>.NET</strong>: WixWiki pages about <a href="http://www.wixwiki.com/index.php?title=Custom_Action_Type_2">checking for .NET</a> runtime and <a href="http://www.wixwiki.com/index.php?title=Deploying_Additional_Components">deploying it with a bootstrapper generated with MSBuild</a>;</li>
<li>Another WiX wiki on mindcapers.net, I particularily needed <a href="http://wix.mindcapers.com/wiki/ICE38">ICE38 error explanation</a>;</li>
<li>John Robbins&#8217; blog entry on patching <a href="http://www.wintellect.com/cs/blogs/jrobbins/archive/2007/12/10/cumulative-patching-with-wix-2-0.aspx">patching</a> with WiX. <em>You don&#8217;t want number of auto-update patches to grow quadratically</em>?</li>
<li>Last but not the least, <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/using_properties.asp">MSI properties reference</a> on MSDN.</li>
</ul>
<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:70px;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fvictorsergienko.com%2Fwix-net-linkdump-samples-howto-s%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe></div><div class="really_simple_share_google1" style="width:60px;"><div class="g-plusone" data-size="medium" data-href="http://victorsergienko.com/wix-net-linkdump-samples-howto-s/" data-annotation="none"></div></div><div class="really_simple_share_twitter" style="width:70px;"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none" 
						data-text="WiX linkdump: samples and howto-s I found, mostly .NET deployment" data-url="http://victorsergienko.com/wix-net-linkdump-samples-howto-s/" 
						data-via=""  ></a></div></div>
		<div style="clear:both;"></div>]]></content:encoded>
			<wfw:commentRss>http://victorsergienko.com/wix-net-linkdump-samples-howto-s/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>NAnt vs MSBuild funnies</title>
		<link>http://victorsergienko.com/nant-vs-msbuild-versioning-internalsvisibleto/</link>
		<comments>http://victorsergienko.com/nant-vs-msbuild-versioning-internalsvisibleto/#comments</comments>
		<pubDate>Thu, 20 Mar 2008 19:11:49 +0000</pubDate>
		<dc:creator>Victor Sergienko</dc:creator>
				<category><![CDATA[Main]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[MSBuild]]></category>
		<category><![CDATA[NAnt]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://victorsergienko.com/nant-vs-msbuild-versioning-internalsvisibleto/</guid>
		<description><![CDATA[All the software is equally bad&#8230; Well, I know some pieces of software that are good, but I won&#8217;t mention them today. One of our msbuild vs nant choice criteria is  a product versioning support. Sad or funny things are: both don&#8217;t include sane tool out of box; both need installing NAntContrib or MSBuild Community [...]]]></description>
			<content:encoded><![CDATA[<p>All the software is equally bad&#8230;</p>
<p>Well, I know some pieces of software that are good, but I won&#8217;t mention them today.</p>
<p>One of our <strong><a href="http://victorsergienko.com/msbuild-teambuild-vs-nant/">msbuild vs nant</a> choice criteria</strong> is  a product versioning support.</p>
<p>Sad or funny things are:</p>
<ul>
<li>both don&#8217;t include sane tool out of box;</li>
<li>both need installing <a href="http://nantcontrib.sourceforge.net/">NAntContrib</a> or <a href="http://msbuildtasks.tigris.org/servlets/ProjectMailingListList">MSBuild Community Tasks</a>;</li>
<li>even then <strong>both can&#8217;t sanely write AssemblyInfo.cs</strong> in order to leave other properties intact; if you had <a href="http://msdn2.microsoft.com/en-us/library/system.runtime.compilerservices.internalsvisibletoattribute.aspx">InternalsVisibleTo</a> satellite unit test assembly &#8211; it won&#8217;t build then;</li>
</ul>
<p><a href="http://nantcontrib.sourceforge.net/release/latest/help/tasks/version.html">NAntContrib Version task</a> is way more functional.</p>
<p>Additionally, MSDN page design where <a href="http://msdn2.microsoft.com/en-us/library/0k6kkbsd.aspx">MSBuild reference</a> manual lives, is awful.</p>
<p>I wonder if it&#8217;s the reason to choose a build tool, while they are approximately equal.</p>
<p>OTOH, MSBuild has a great <a rel="nofollow" href="http://www.wixwiki.com/index.php?title=Deploying_Additional_Components">GenerateBootstrapper</a> task to install .NET framework from MSI (WiX sample included in the referenced wiki).</p>
<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:70px;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fvictorsergienko.com%2Fnant-vs-msbuild-versioning-internalsvisibleto%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe></div><div class="really_simple_share_google1" style="width:60px;"><div class="g-plusone" data-size="medium" data-href="http://victorsergienko.com/nant-vs-msbuild-versioning-internalsvisibleto/" data-annotation="none"></div></div><div class="really_simple_share_twitter" style="width:70px;"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none" 
						data-text="NAnt vs MSBuild funnies" data-url="http://victorsergienko.com/nant-vs-msbuild-versioning-internalsvisibleto/" 
						data-via=""  ></a></div></div>
		<div style="clear:both;"></div>]]></content:encoded>
			<wfw:commentRss>http://victorsergienko.com/nant-vs-msbuild-versioning-internalsvisibleto/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Auto-update with WiX</title>
		<link>http://victorsergienko.com/automatic-auto-update-and-wix/</link>
		<comments>http://victorsergienko.com/automatic-auto-update-and-wix/#comments</comments>
		<pubDate>Wed, 12 Mar 2008 11:43:12 +0000</pubDate>
		<dc:creator>Victor Sergienko</dc:creator>
				<category><![CDATA[Main]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[WiX]]></category>

		<guid isPermaLink="false">http://victorsergienko.com/automatic-auto-update-and-wix/</guid>
		<description><![CDATA[Update: for a ready solution (library), see official release announcement Windows Installer on itself is a pain. WiX saves you from it, mostly wrapping the complexity into XML constructs understandable to non-gurus. Well, not completely &#8211; you still have to know: why the heck shortcut didn&#8217;t appear in start menu; how to create a web [...]]]></description>
			<content:encoded><![CDATA[<p>Update: for a ready solution (library), see <a href="http://victorsergienko.com/self-update-library-for-net-using-wix-dotupdater/">official release announcement</a> <img src='http://victorsergienko.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Windows Installer on itself is a pain. <a href="http://wix.sourceforge.net/">WiX</a> saves you from it, mostly wrapping the complexity into XML constructs understandable to non-gurus.</p>
<p>Well, not completely &#8211; you still have to know:</p>
<ul>
<li>why the heck shortcut didn&#8217;t appear in start menu;</li>
<li>how to create a web site shortcut;</li>
<li>why to create RegistryValue for a program directory you create, and that&#8217;s the simplest things. <em>Still better then MFC&#8230;</em></li>
</ul>
<p>But a very good <a href="http://www.tramontana.co.hu/wix/">tutorial</a> exists, maillist is very active and it&#8217;s easy to get support.<br />
<em>Maybe it&#8217;s another reason to love Unix-es, where &#8220;install <strong>IS</strong> just a copy&#8221;.<br />
Though, one has to admit that installing Windows application involves somewhat more desktop integration</em>.</p>
<p>I was looking  for an auto-update, so that:</p>
<ul>
<li>application could say &#8220;<strong>New version available, download? Restart now?</strong>&#8220;;</li>
<li>would use MSI;</li>
<li>download should preferably use <a href="http://msdn.microsoft.com/msdnmag/issues/03/02/bits/TOC.ASP">BITS</a>.</li>
</ul>
<p>Simple automatic updaters like <a href="http://www.codeproject.com/KB/vb/Auto_Update_Revisited.aspx">this</a> on Codeproject won&#8217;t do, because you can&#8217;t just download necessary files: Windows Installer will revert them back. Or you would have to &#8220;<a href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q303439">disable WI&#8217;s Resiliency</a>&#8220;, which is also a bad idea.</p>
<h3>Solution of my choice</h3>
<p><a href="http://wix.sourceforge.net/clickthrough.html">ClickThrough</a> subproject of WiX <a href="http://wix.sourceforge.net/ctvision.html">promises</a> that, but it&#8217;s still beta and crashes. Still you can easily compare two MSI files, generate a <a href="http://trentm.com/blog/archives/2007/05/29/wix-and-msp/">MSP patch</a>, and a RSS feed that client can check, download and even read by eye, so simple it is &#8211; a pretty tasty feature.</p>
<p>There is no .NET client code. For now, there is only a separate update.exe that will find, download and install new version. Still, you cannot ask user whether to download now or not, cannot tell what&#8217;s new, when to restart, etc.<br />
But you can painlessly add a Start menu shortcut that will update your application.</p>
<p>Come later, I&#8217;m going to create a C# code that will check for updates, and probably publish it.</p>
<h3>Other solutions</h3>
<p>You can use <a href="http://msdn2.microsoft.com/en-us/library/ms978574.aspx">Updater ApplicationBlock</a>, or more exactly, latest version now <a href="http://www.codeplex.com/smartclient/Wiki/View.aspx?title=Updater%20Application%20Block">lives at CodePlex</a>. But Enterprise Library wasn&#8217;t updated for .NET 3.5, and I believe it&#8217;s abandoned.</p>
<p>You can use <a href="http://nsis.sourceforge.net/">NSIS</a>. Though, it&#8217;s not Windows Installer MSI packager, it creates own files and scripts.</p>
<p>For ClickOnce application, you can use <a href="http://msdn2.microsoft.com/en-us/library/system.deployment.application.aspx">Application.Deployment</a>.</p>
<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:70px;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fvictorsergienko.com%2Fautomatic-auto-update-and-wix%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe></div><div class="really_simple_share_google1" style="width:60px;"><div class="g-plusone" data-size="medium" data-href="http://victorsergienko.com/automatic-auto-update-and-wix/" data-annotation="none"></div></div><div class="really_simple_share_twitter" style="width:70px;"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none" 
						data-text="Auto-update with WiX" data-url="http://victorsergienko.com/automatic-auto-update-and-wix/" 
						data-via=""  ></a></div></div>
		<div style="clear:both;"></div>]]></content:encoded>
			<wfw:commentRss>http://victorsergienko.com/automatic-auto-update-and-wix/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

