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

<channel>
	<title>NN - WordPress</title>
	<atom:link href="http://nn1234.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://nn1234.wordpress.com</link>
	<description>This worth it</description>
	<lastBuildDate>Thu, 21 Apr 2011 11:17:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='nn1234.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>NN - WordPress</title>
		<link>http://nn1234.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://nn1234.wordpress.com/osd.xml" title="NN - WordPress" />
	<atom:link rel='hub' href='http://nn1234.wordpress.com/?pushpress=hub'/>
		<item>
		<title>C++ Standard #pragma region</title>
		<link>http://nn1234.wordpress.com/2011/04/21/pragma_region/</link>
		<comments>http://nn1234.wordpress.com/2011/04/21/pragma_region/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 11:15:12 +0000</pubDate>
		<dc:creator>NN</dc:creator>
				<category><![CDATA[c++]]></category>

		<guid isPermaLink="false">http://nn1234.wordpress.com/?p=161</guid>
		<description><![CDATA[#pragma region is a handy tool for code folding. But it is not in C++ standard. How can it be solved ? Very simply with #ifdef + #define. And we get the following picture:<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nn1234.wordpress.com&amp;blog=1745292&amp;post=161&amp;subd=nn1234&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://msdn.microsoft.com/en-us/library/b6xkz944(v=VS.100).aspx">#pragma region</a> is a handy tool for code folding.</p>
<p>But it is not in C++ standard.<br />
How can it be solved ?</p>
<p>Very simply with #ifdef + #define.</p>
<p>And we get the following picture:<br />
<img src="http://nn1234.files.wordpress.com/2011/04/unfold.png?w=620" alt="Unfold" /></p>
<p><img src="http://nn1234.files.wordpress.com/2011/04/fold.png?w=620" alt="Fold" /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nn1234.wordpress.com/161/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nn1234.wordpress.com/161/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nn1234.wordpress.com/161/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nn1234.wordpress.com/161/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nn1234.wordpress.com/161/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nn1234.wordpress.com/161/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nn1234.wordpress.com/161/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nn1234.wordpress.com/161/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nn1234.wordpress.com/161/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nn1234.wordpress.com/161/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nn1234.wordpress.com/161/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nn1234.wordpress.com/161/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nn1234.wordpress.com/161/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nn1234.wordpress.com/161/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nn1234.wordpress.com&amp;blog=1745292&amp;post=161&amp;subd=nn1234&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nn1234.wordpress.com/2011/04/21/pragma_region/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/742dd90e244e5bb0e4d55d0936b5af94?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">NN</media:title>
		</media:content>

		<media:content url="http://nn1234.files.wordpress.com/2011/04/unfold.png" medium="image">
			<media:title type="html">Unfold</media:title>
		</media:content>

		<media:content url="http://nn1234.files.wordpress.com/2011/04/fold.png" medium="image">
			<media:title type="html">Fold</media:title>
		</media:content>
	</item>
		<item>
		<title>C++, Microsoft Visual Studio 2010 and old .Net framework</title>
		<link>http://nn1234.wordpress.com/2011/04/10/c-microsoft-visual-studio-2010-and-old-net-framework/</link>
		<comments>http://nn1234.wordpress.com/2011/04/10/c-microsoft-visual-studio-2010-and-old-net-framework/#comments</comments>
		<pubDate>Sun, 10 Apr 2011 12:11:49 +0000</pubDate>
		<dc:creator>NN</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[c++]]></category>

		<guid isPermaLink="false">http://nn1234.wordpress.com/?p=152</guid>
		<description><![CDATA[As you know it is not possible to compile C++ CLR program targeting old .Net 2.0 framework with new VC2010  compiler. Check out Here and Here. There is a little hack to allow this but it needs some investigations. Create a C++/CLI project in VS2010. In Project Properties -&#62; VC++ Directories set Include, Lib, Src [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nn1234.wordpress.com&amp;blog=1745292&amp;post=152&amp;subd=nn1234&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As you know it is not possible to compile C++ CLR program targeting old .Net 2.0 framework with new VC2010  compiler.</p>
<p>Check out <a href="http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/6d84ee0c-0007-47b1-8628-d80191c80295/">Here</a> and <a href="https://connect.microsoft.com/VisualStudio/feedback/details/567504/targeting-frameworks-other-than-4-0-with-c-cli-project-and-v100-platform-toolset">Here</a>.</p>
<p>There is a little hack to allow this but it needs some investigations.</p>
<p>Create a C++/CLI project in VS2010.</p>
<p>In Project Properties -&gt; VC++ Directories set Include, Lib, Src to VC++ 9.0 directories. (%Program Files(x86)%\Microsoft Visual Studio 9.0\VC\&#8230;)</p>
<p>Voila ! Now Reflector shows us references only to mscorlib v2.0 !</p>
<p>You can use any C++0x features supported in C++/CLI too.</p>
<p><strong>The problem:</strong></p>
<p>It was simple and powerful but not perfect.</p>
<p>After you run the program you get:</p>
<pre>Unhandled Exception: System.Runtime.InteropServices.SEHException: External component has thrown an exception.
   at System.EventHandler.Invoke(Object sender, EventArgs e)
   at .ModuleUninitializer.SingletonDomainUnload(Object source, EventArgs arguments)</pre>
<p><strong>Solution:</strong></p>
<p>Open the file in Hex Editor.</p>
<p>Replace &#8220;v4.0.30319&#8243; with &#8220;v2.0.50727&#8243; and it works !</p>
<p><strong>Resuming it again:</strong></p>
<p>We can use C++0x &amp; C++/CLI &amp; Visual Studio 2010 !</p>
<p>Update:<br />
I have tweaked &#8220;%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\PlatformToolsets&#8221;  for the new platform I called v100.2<br />
Now it is so easy to compile C++/CLI <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://pastebin.com/anLvMDSj">&#8220;c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\PlatformToolsets\v100.2\Microsoft.Cpp.Win32.v100.2.props&#8221;</a><br />
<a href="http://pastebin.com/F12MQ9YQ">&#8220;c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\PlatformToolsets\v100.2\Microsoft.Cpp.x64.v100.2.props&#8221;</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nn1234.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nn1234.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nn1234.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nn1234.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nn1234.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nn1234.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nn1234.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nn1234.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nn1234.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nn1234.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nn1234.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nn1234.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nn1234.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nn1234.wordpress.com/152/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nn1234.wordpress.com&amp;blog=1745292&amp;post=152&amp;subd=nn1234&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nn1234.wordpress.com/2011/04/10/c-microsoft-visual-studio-2010-and-old-net-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/742dd90e244e5bb0e4d55d0936b5af94?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">NN</media:title>
		</media:content>
	</item>
		<item>
		<title>Don&#8217;t do it in your code</title>
		<link>http://nn1234.wordpress.com/2011/03/13/dont-do-it-in-your-code/</link>
		<comments>http://nn1234.wordpress.com/2011/03/13/dont-do-it-in-your-code/#comments</comments>
		<pubDate>Sun, 13 Mar 2011 14:35:41 +0000</pubDate>
		<dc:creator>NN</dc:creator>
				<category><![CDATA[c++]]></category>

		<guid isPermaLink="false">http://nn1234.wordpress.com/?p=150</guid>
		<description><![CDATA[As you know C++ suffers from smart enums. You cannot get a name from the value in a standard way. Many people invent some tables, maps and so on but here in code this approach is taken much further. #include &#60;sstream&#62; enum MyEnum { VALUE1, VALUE2, VALUE3, }; char* operator*( MyEnum s ) { switch(s) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nn1234.wordpress.com&amp;blog=1745292&amp;post=150&amp;subd=nn1234&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As you know C++ suffers from smart enums.</p>
<p>You cannot get a name from the value in a standard way.</p>
<p>Many people invent some tables, maps and so on but here in code this approach is taken much further.</p>
<pre><code>
#include &lt;sstream&gt;

enum MyEnum
{
	VALUE1,
	VALUE2,
	VALUE3,
};

<strong>char* operator*( MyEnum s )</strong>
{
	switch(s)
	{
		case VALUE1: return "VALUE1";
		case VALUE2: return "VALUE2";
		case VALUE3: return "VALUE3";
	}
}

int main()
{
	using namespace std;

	ostringstream s;
	MyEnum r = VALUE3;
	s &lt;&lt; "MyEnum is" &lt;&lt; *(MyEnum)r;
}
</code>
</pre>
<p>Never ever do it, it confuses the reader.</p>
<p>Provide a normal function name and don&#8217;t mess with operators in the wrong place.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nn1234.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nn1234.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nn1234.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nn1234.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nn1234.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nn1234.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nn1234.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nn1234.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nn1234.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nn1234.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nn1234.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nn1234.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nn1234.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nn1234.wordpress.com/150/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nn1234.wordpress.com&amp;blog=1745292&amp;post=150&amp;subd=nn1234&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nn1234.wordpress.com/2011/03/13/dont-do-it-in-your-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/742dd90e244e5bb0e4d55d0936b5af94?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">NN</media:title>
		</media:content>
	</item>
		<item>
		<title>Object initialization in different contexts</title>
		<link>http://nn1234.wordpress.com/2011/03/13/object-initialization-in-different-contexts/</link>
		<comments>http://nn1234.wordpress.com/2011/03/13/object-initialization-in-different-contexts/#comments</comments>
		<pubDate>Sun, 13 Mar 2011 08:21:24 +0000</pubDate>
		<dc:creator>NN</dc:creator>
				<category><![CDATA[c++]]></category>

		<guid isPermaLink="false">http://nn1234.wordpress.com/?p=143</guid>
		<description><![CDATA[As you know you can use object initialization in regular context: int main() { MyClass a(1); MyStruct b= { 2 }; } Some know that you can create object in for loop: for (int i = 0; ; ) ... But not many people know that you can also create object in &#8216;if&#8217; statement : [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nn1234.wordpress.com&amp;blog=1745292&amp;post=143&amp;subd=nn1234&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As you know you can use object initialization in regular context:</p>
<pre><code>
int main()
{
  MyClass a(1);
  MyStruct b= { 2 };
}
</code></pre>
<p>Some know that you can create object in for loop:<br />
<code><br />
for (<strong>int i = 0</strong>; ; ) ...<br />
</code></p>
<p>But not many people know that you can also create object in &#8216;if&#8217; statement :<br />
<code><br />
if (int i = 0) {}<br />
else { cout &lt;&lt; i; }<br />
</code></p>
<p>Pay attention that you can use the newly created object in &#8216;else&#8217; part !</p>
<p>How it works ?<br />
We create object with type &#8216;int&#8217; , assign to it 0 and then check the result.<br />
What is the result ? It the object itself. As you know int is convertible to bool.</p>
<p>But how it works with more complicated objects ?</p>
<pre><code>
class A
{
public:
  A(int) {}
};

if (A a) {}
</code></pre>
<p>Here we have incorrect code. How we make it correct ?<br />
We need conversion to boolean from A type. So add it and make working code <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<pre><code>class A
{
public:
  A(int) {}

  operator bool() const { return false; }
};

if (A a) {}
else { /* Use a */ }</code></pre>
<p>So the real question <strong>&#8220;Where is it useful at all ?&#8221;</strong>.<br />
It is usable in log subsystem or when you need to not compute the expression when it is not needed.<br />
Suppose you want something like this:</p>
<p>WHEN_LOG_ENABLED_FORMAT_STRING() &lt;&lt; &#8220;a&#8221;;<br />
(See <a href="http://boost-log.sourceforge.net/libs/log/doc/html/index.html">Boost.Log</a> )</p>
<p>How you implement this ?<br />
Very simply <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<pre><code>
#define WHEN_LOG_ENABLED_FORMAT_STRING() \
  if (!logEnabled) {} \
  else StringFormatter()
</code></pre>
<p>And if we need to create the object but only when the log is enabled we use the trick from above:</p>
<pre><code>
#define WHEN_LOG_ENABLED_FORMAT_STRING() \
  if (!logEnabled) {} \
  else \
  if (StringFormatter sf = StringFormatter()) {} \
  else sf
</code></pre>
<p>Again, why is it useful ?<br />
Remember that std::ostream has overload only for std::ostream&amp; and not for reference to const ?<br />
So we must create an object in order to use the std::ostringstream, here we can create it and we don&#8217;t need some special _END_ macro.</p>
<p>Any questions ?:)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nn1234.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nn1234.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nn1234.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nn1234.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nn1234.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nn1234.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nn1234.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nn1234.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nn1234.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nn1234.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nn1234.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nn1234.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nn1234.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nn1234.wordpress.com/143/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nn1234.wordpress.com&amp;blog=1745292&amp;post=143&amp;subd=nn1234&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nn1234.wordpress.com/2011/03/13/object-initialization-in-different-contexts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/742dd90e244e5bb0e4d55d0936b5af94?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">NN</media:title>
		</media:content>
	</item>
		<item>
		<title>C++ and non inheritable (derivable, final, sealed) class</title>
		<link>http://nn1234.wordpress.com/2010/11/08/c-and-non-inheritable-derivable-final-sealed-class/</link>
		<comments>http://nn1234.wordpress.com/2010/11/08/c-and-non-inheritable-derivable-final-sealed-class/#comments</comments>
		<pubDate>Mon, 08 Nov 2010 17:42:06 +0000</pubDate>
		<dc:creator>NN</dc:creator>
				<category><![CDATA[c++]]></category>

		<guid isPermaLink="false">http://nn1234.wordpress.com/?p=136</guid>
		<description><![CDATA[The question is rather simple. How to disallow deriving from a class or a struct in C++ ? The answer is simple enough. It is impossible in C++. That&#8217;s right. There are no restrictions, no keywords to disallow this. There are plenty of tricks like private constructor, private destructor, pure virtual destructor and so on. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nn1234.wordpress.com&amp;blog=1745292&amp;post=136&amp;subd=nn1234&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The question is rather simple. How to disallow deriving from a class or a struct in C++ ?<br />
The answer is simple enough. It is impossible in C++.</p>
<p>That&#8217;s right. There are no restrictions, no keywords to disallow this.</p>
<p>There are plenty of tricks like private constructor, private destructor, pure virtual destructor and so on.<br />
But none of them works.<br />
Actually it works but not as you wanted it to work.<br />
You can derive, but you cannot create an instance. But these things are very different.</p>
<p>So at last, I give some non working example:<br />
<code class="cpp">class a<br />
{<br />
private: a(int no_default_constructor) {}<br />
private: virtual ~a() = 0;<br />
};</code><br />
// You still can derive ! Ha ha<br />
class b : a {}</p>
<p>// But you cannot create an instance, not actually what we wanted<br />
b b1; // Error</p>
<p>There will be something to do so in <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3151.html">C++0x</a>. We are waiting..</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nn1234.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nn1234.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nn1234.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nn1234.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nn1234.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nn1234.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nn1234.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nn1234.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nn1234.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nn1234.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nn1234.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nn1234.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nn1234.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nn1234.wordpress.com/136/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nn1234.wordpress.com&amp;blog=1745292&amp;post=136&amp;subd=nn1234&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nn1234.wordpress.com/2010/11/08/c-and-non-inheritable-derivable-final-sealed-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/742dd90e244e5bb0e4d55d0936b5af94?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">NN</media:title>
		</media:content>
	</item>
		<item>
		<title>Jabber</title>
		<link>http://nn1234.wordpress.com/2010/08/11/jabber/</link>
		<comments>http://nn1234.wordpress.com/2010/08/11/jabber/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 15:45:58 +0000</pubDate>
		<dc:creator>NN</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nn1234.wordpress.com/?p=132</guid>
		<description><![CDATA[It is becoming very popular. The needed social networking sites have moved to Jabber protocol support. If you haven&#8217;t known about this, here is the list: VKontakte Facebook Google Talk Why is it good ? You don&#8217;t need your crap browser to be open, just ,one in my case, program for chat. Like Miranda IM<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nn1234.wordpress.com&amp;blog=1745292&amp;post=132&amp;subd=nn1234&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It is becoming very popular.<br />
The needed social networking sites have moved to Jabber protocol support.<br />
If you haven&#8217;t known about this, here is the list:</p>
<p><a href="http://vkontakte.ru/help.php?page=jabber">VKontakte</a><br />
<a href="http://www.facebook.com/sitetour/chat.php">Facebook</a><br />
<a href="http://www.google.com/talk/otherclients.html">Google Talk</a></p>
<p>Why is it good ?<br />
You don&#8217;t need your crap browser to be open, just ,one in my case, program for chat.<br />
Like <a href="http://www.miranda-im.org/">Miranda IM</a> <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nn1234.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nn1234.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nn1234.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nn1234.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nn1234.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nn1234.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nn1234.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nn1234.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nn1234.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nn1234.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nn1234.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nn1234.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nn1234.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nn1234.wordpress.com/132/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nn1234.wordpress.com&amp;blog=1745292&amp;post=132&amp;subd=nn1234&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nn1234.wordpress.com/2010/08/11/jabber/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/742dd90e244e5bb0e4d55d0936b5af94?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">NN</media:title>
		</media:content>
	</item>
		<item>
		<title>Choose container carefully</title>
		<link>http://nn1234.wordpress.com/2010/06/02/choose-container-carefully/</link>
		<comments>http://nn1234.wordpress.com/2010/06/02/choose-container-carefully/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 07:29:54 +0000</pubDate>
		<dc:creator>NN</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nn1234.wordpress.com/?p=123</guid>
		<description><![CDATA[Let&#8217;s talk about C++ language. If you are asked which container class should I use, the most common answer will be try std::vector. The correct answer is in fact a question, what do you want from the container to do. Why is this so important ? std::vector fits almost in all cases. The key word [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nn1234.wordpress.com&amp;blog=1745292&amp;post=123&amp;subd=nn1234&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s talk about C++ language.</p>
<p>If you are asked which container class should I use, the most common answer will be try std::vector.</p>
<p>The correct answer is in fact a question, what do you want from the container to do.</p>
<p>Why is this so important ? std::vector fits almost in all cases.</p>
<p>The key word is &#8216;almost&#8217;.</p>
<p>What does std::vector provide us ?</p>
<p>No O(1) insertion but continuous memory allocation. Do we need this ??</p>
<p>If you check your code, you can see that in most cases you just need a list of items without carrying if they are allocated on the continuous memory space.</p>
<p>It is useful only for buffer to be passed to C code or to be written as-is to the file.</p>
<p>So, obviously the number one candidate is std::list and not std::vector!</p>
<p>It is true to say, premature optimization is evil, but in this case it is not an optimization it is a logical problem, you use the incorrect tool.</p>
<p>The same problem exists in .Net or Java, most people choose List&lt;T&gt; or ArrayList without thinking at all, while the usage doesn&#8217;t involve random access.</p>
<p>Actually the problem in .Net or Java is not so serious since memory allocation is very fast but still it has a logical problem.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nn1234.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nn1234.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nn1234.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nn1234.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nn1234.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nn1234.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nn1234.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nn1234.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nn1234.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nn1234.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nn1234.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nn1234.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nn1234.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nn1234.wordpress.com/123/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nn1234.wordpress.com&amp;blog=1745292&amp;post=123&amp;subd=nn1234&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nn1234.wordpress.com/2010/06/02/choose-container-carefully/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/742dd90e244e5bb0e4d55d0936b5af94?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">NN</media:title>
		</media:content>
	</item>
		<item>
		<title>C++ delayed initialization</title>
		<link>http://nn1234.wordpress.com/2010/05/24/c-delayed-initialization/</link>
		<comments>http://nn1234.wordpress.com/2010/05/24/c-delayed-initialization/#comments</comments>
		<pubDate>Mon, 24 May 2010 10:40:39 +0000</pubDate>
		<dc:creator>NN</dc:creator>
				<category><![CDATA[boost]]></category>
		<category><![CDATA[c++]]></category>

		<guid isPermaLink="false">http://nn1234.wordpress.com/?p=114</guid>
		<description><![CDATA[How many times have you written a code which checks conditions and only then decides what to do ? Let&#8217;s take a simple example: class DelayedInitialization : boost::noncopyable { public: DelayedInitialization(int i) : i(i) {} int I() const { return i; } private: int i; }; class Some { public: Some(int i) : d(i) // [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nn1234.wordpress.com&amp;blog=1745292&amp;post=114&amp;subd=nn1234&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>How many times have you written a code which checks conditions and only then decides what to do ? <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Let&#8217;s take a simple example:</p>
<pre>class DelayedInitialization : boost::noncopyable
{
public:
	DelayedInitialization(int i) : i(i) {}

	int I() const { return i; }

private:
	int i;
};

class Some
{
public:
	Some(int i)
		: d(i) // check i &gt; 0
	{
	}

private:
	DelayedInitialization d;
};
</pre>
<p>How do we add a check ?</p>
<p>The simplest solution is to use a pointer. Of course we want RAII so we use one of smart pointers written for us.</p>
<p>The best choice here is to use <strong>boost::scoped_ptr</strong>. Neither std::auto_ptr and absolutely not boost::shared_ptr.</p>
<p>* std::auto_ptr gives much more power than we need. We don&#8217;t want accidentally transfer ownership.</p>
<p>* boost::shared_ptr gives us reference count which is useless in our case, moreover it involves synchronization penalty where we don&#8217;t need it.</p>
<p>The boost::scoped_ptr has a minimal set of features and the minimum required power.</p>
<pre>class DelayedInitialization : boost::noncopyable
{
public:
	DelayedInitialization(int i) : i(i) {}

	int I() const { return i; }

private:
	int i;
};

class Some
{
public:
	Some(int i)
	{
		if(i &lt;= 0)
			throw std::exception();

		<strong>d.reset(new DelayedInitialization(i));</strong>
	}

private:
	<strong>boost::scoped_ptr&lt;DelayedInitialization&gt; d;</strong>
};
</pre>
<p>It is nice but we evolve here memory allocation instead of using variable on the stack.</p>
<p>Another possible solution is to add a function and a dummy variable used for checking, almost perfect:</p>
<pre>class DelayedInitialization : boost::noncopyable
{
public:
	DelayedInitialization(int i) : i(i) {}

	int I() const { return i; }

private:
	int i;
};

class Some
{
public:
	Some(int i)
		<strong>: checker(check(i))</strong>
		, d(i)
	{
	}

private:
	<em>bool check(int i)
	{
		if(i &lt;= 0)
			throw std::exception();

		return true;
	}</em>

	bool checker;
        DelayedInitialization d;
};
</pre>
<p>While this solves the given problem, this doesn&#8217;t solve the problem where Some has a base class and wants to add some checks before continuing.</p>
<p>It can be achieved with a slightly modified check method:</p>
<pre>class Base
{
public:
	Base(int i)
	{
	}
};

class Some : public Base
{
public:
	Some(int i)
		: Base(checkI(i))
		, d(i)
	{
	}

private:
	int checkI(int i)
	{
		if(i &lt;= 0)
			throw std::exception();

		return i;
	}

	DelayedInitialization d;
};
</pre>
<p>Actually this is very neat solution and no additional member is needed !</p>
<p>Now take a real world problem: How to initialize the member in the constructor body rather than in initialization list without memory allocation ?</p>
<p>In short we want the following constructor:</p>
<pre>Some(int i)
{
	std::cout &lt;&lt; "Some code\n";

	// Magic constructor call
	d.__constructor(i);
}
</pre>
<p>How do we achieve this ?<br />
Simple enough.<br />
1. Allocate enough stack size for the needed object, also make the stack allocation aligned.</p>
<p>boost::aligned_storage solves this problem. 2. Call constructor and destructor manually.</p>
<p>Use placement new and destructor call.</p>
<pre>class DelayedInitialization : boost::noncopyable
{
public:
	DelayedInitialization(int i) : i(i)
	{
		std::cout &lt;&lt; "DelayedInitialization. i =  "
			&lt;&lt; i &lt;&lt; std::endl;
	}

	int I() const { return i; }

private:
	int i;
};

class Some
{
public:
	Some(int i)
	{
		std::cout &lt;&lt; "Some code\n";

		// Magic constructor
		<strong>::new(d.address()) DelayedInitialization(i);</strong>
	}

	~Some()
	{
		// Don't forget for destructor
		<strong>static_cast&lt;DelayedInitialization*&gt;(
				d.address())-&gt;~DelayedInitialization();</strong>
	}

private:
	boost::aligned_storage&lt;sizeof(DelayedInitialization)&gt; d;
};
</pre>
<p>Now we got what we need.<br />
No unneeded memory allocation at all !<br />
No run-time penalty if the object has to remain uninitialized. (Actually we need a small boolean to check if the object was initialized or not).</p>
<p>A small helper class and we are set:</p>
<pre>class DelayedInitialization : boost::noncopyable
{
public:
	DelayedInitialization(int i) : i(i)
	{
		std::cout &lt;&lt; "DelayedInitialization. i = "
				&lt;&lt; i &lt;&lt; std::endl;
	}

	int I() const { return i; }

private:
	int i;
};

template&lt;typename T&gt;
class stack_allocation_ptr
{
public:
	stack_allocation_ptr()
		: initialized(false)
	{
	}

	~stack_allocation_ptr()
	{
		if (initialized)
			static_cast&lt;T*gt;(d.address())-&gt;~T();
	}

	// We know nothing about underlying type
	// Provide all possible function overloads
	void reset()
	{
		if (initialized)
			throw std::exception();

		::new(d.address()) T();
	}

	template&lt;typename P0&gt;
	void reset(P0 p0)
	{
		if (initialized)
			throw std::exception();

		::new(d.address()) T(p0);
		initialized = true;
	}

	T* operator-&gt;()
	{
		return &amp;d;
	}

	T const* operator-&gt;() const
	{
		return &amp;d;
	}

private:
	bool initialized;
	boost::aligned_storage&lt;sizeof(T)&gt; d;
};

class Some
{
public:
	Some(int i)
	{
		std::cout &lt;&lt; "Some code\n";

		// Magic constructor
		d.reset(i);
	}

private:
	stack_allocation_ptr&lt;DelayedInitialization&gt; d;
};
</pre>
<p>We have two problems here.<br />
1. We must forward all arguments to constructor. (The forwarding problem)</p>
<p>This problem is not discussed now.</p>
<p>2. We may want to remove initialized member.</p>
<p>It is easy enough to do:)</p>
<p>Conclusion: C++ has better supported a regular initialization instead of two initialization forms.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nn1234.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nn1234.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nn1234.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nn1234.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nn1234.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nn1234.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nn1234.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nn1234.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nn1234.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nn1234.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nn1234.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nn1234.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nn1234.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nn1234.wordpress.com/114/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nn1234.wordpress.com&amp;blog=1745292&amp;post=114&amp;subd=nn1234&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nn1234.wordpress.com/2010/05/24/c-delayed-initialization/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/742dd90e244e5bb0e4d55d0936b5af94?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">NN</media:title>
		</media:content>
	</item>
		<item>
		<title>Double Commander</title>
		<link>http://nn1234.wordpress.com/2010/04/14/double-commander/</link>
		<comments>http://nn1234.wordpress.com/2010/04/14/double-commander/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 11:04:29 +0000</pubDate>
		<dc:creator>NN</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nn1234.wordpress.com/?p=110</guid>
		<description><![CDATA[The &#8220;Commander&#8221;s war still takes place. One likes XCommander and other likes YCommander. By the word Commander I mean some program with dual (or more) panel interface. Since most &#8220;Explorer&#8221;s has only one panel , and many see this it as unpractical , there are Commanders programs. The most known for Windows is Total Commander [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nn1234.wordpress.com&amp;blog=1745292&amp;post=110&amp;subd=nn1234&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The &#8220;Commander&#8221;s war still takes place.</p>
<p>One likes XCommander and other likes YCommander.</p>
<p>By the word Commander I mean some program with dual (or more) panel interface. Since most &#8220;Explorer&#8221;s has only one panel , and many see this it as unpractical , there are Commanders programs.</p>
<p>The most known for Windows is Total Commander (Windows Commander in the past) but as many others it costs money.</p>
<p>The other disadvantage it has no x64 build and probably will never get it.</p>
<p>So what you do in x64 ??</p>
<p>You need freeware commander with x64 build.<br />
<a href="http://doublecmd.sourceforge.net/">Double Commander</a> has all needed features.<br />
It is freeware, can work both on Linux and Windows, has both 32 and 64bit builds and the nicest part,<br />
it supports Total Commander plugins too !</p>
<p>After trying freeCommander, muCommander, UnrealCommander and others trying to find an alternative to the perfect TotalCommander, <a href="http://doublecmd.sourceforge.net/">Double Commander</a> is the best alternative for today.</p>
<p>It is your choice to use free programs or to pay money <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nn1234.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nn1234.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nn1234.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nn1234.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nn1234.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nn1234.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nn1234.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nn1234.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nn1234.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nn1234.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nn1234.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nn1234.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nn1234.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nn1234.wordpress.com/110/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nn1234.wordpress.com&amp;blog=1745292&amp;post=110&amp;subd=nn1234&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nn1234.wordpress.com/2010/04/14/double-commander/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/742dd90e244e5bb0e4d55d0936b5af94?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">NN</media:title>
		</media:content>
	</item>
		<item>
		<title>Backups are important</title>
		<link>http://nn1234.wordpress.com/2010/04/13/backups-are-important/</link>
		<comments>http://nn1234.wordpress.com/2010/04/13/backups-are-important/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 07:54:55 +0000</pubDate>
		<dc:creator>NN</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[SVN]]></category>

		<guid isPermaLink="false">http://nn1234.wordpress.com/2010/04/13/backups-are-important/</guid>
		<description><![CDATA[I have used SVN for a long time, than I started to use Git SVN to be able to commit offline. Git by the way stores all SVN revisions in his repository. Now the question, what happens if SVN server is completely destroyed ? The good answer can be that it is restored from backup. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nn1234.wordpress.com&amp;blog=1745292&amp;post=109&amp;subd=nn1234&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have used SVN for a long time, than I started to use Git SVN to be able to commit offline. Git by the way stores all SVN revisions in his repository.</p>
<p>Now the question, what happens if SVN server is completely destroyed ?<br />
The good answer can be that it is restored from backup. But what if you don&#8217;t have a backup or if you have only nightly backup without several last revisions ?<br />
Even if you have latest SVN working copy you cannot restore entire history because SVN doesn&#8217;t stores the entire log in the repository.</p>
<p>But if you use Git SVN you can restore SVN repository without any problems because Git stores all SVN revisions !! Wooha! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Conclusions:<br />
1. Backup your SVN server for every (!) committed revision. (otherwise you can lose history).<br />
2. If you cannot do the first use source control which stores all SVN revisions so you always have backup.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nn1234.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nn1234.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nn1234.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nn1234.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nn1234.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nn1234.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nn1234.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nn1234.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nn1234.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nn1234.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nn1234.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nn1234.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nn1234.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nn1234.wordpress.com/109/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nn1234.wordpress.com&amp;blog=1745292&amp;post=109&amp;subd=nn1234&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nn1234.wordpress.com/2010/04/13/backups-are-important/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/742dd90e244e5bb0e4d55d0936b5af94?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">NN</media:title>
		</media:content>
	</item>
	</channel>
</rss>
