<?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>Daniele Demichelis &#187; snippet</title>
	<atom:link href="http://www.danidemi.com/mainwww/tag/snippet/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.danidemi.com/mainwww</link>
	<description>There are 10 types of people in the world: Those who understand binary, and those who don&#039;t...</description>
	<lastBuildDate>Wed, 14 Apr 2010 08:14:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Obtain the root logger programmatically in log4net</title>
		<link>http://www.danidemi.com/mainwww/2010/03/obtain-the-root-logger-programmatically-in-log4net/</link>
		<comments>http://www.danidemi.com/mainwww/2010/03/obtain-the-root-logger-programmatically-in-log4net/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 11:15:35 +0000</pubDate>
		<dc:creator>danidemi</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[snippet]]></category>

		<guid isPermaLink="false">http://www.danidemi.com/mainwww/?p=113</guid>
		<description><![CDATA[<p>If you use log4net, you could have the need to configure the loggers programamtically. The problem arise when you want access to the root logger, since the documentation does not explain well how to obtain it.
So, here&#8217;s a snippet that show how to do it. Don&#8217;t forget to imort the log4net namespaces.</p>



using log4net;


using log4net.Core;


using log4net.Appender;


using [...]]]></description>
			<content:encoded><![CDATA[<p>If you use log4net, you could have the need to configure the loggers programamtically. The problem arise when you want access to the root logger, since the documentation does not explain well how to obtain it.<br />
So, here&#8217;s a snippet that show how to do it. Don&#8217;t forget to imort the log4net namespaces.</p>
<div class="geshi no csharp">
<ol>
<li class="li1">
<div class="de1"><span class="kw1">using</span> log4net;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">using</span> log4net.<span class="me1">Core</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">using</span> log4net.<span class="me1">Appender</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">using</span> log4net.<span class="me1">Layout</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">using</span> log4net.<span class="me1">Repository</span>.<span class="me1">Hierarchy</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">using</span> log4net.<span class="me1">Config</span>;</div>
</li>
</ol>
</div>
<div class="geshi no csharp">
<ol>
<li class="li1">
<div class="de1">Hierarchy h <span class="sy0">=</span> <span class="br0">&#40;</span>Hierarchy<span class="br0">&#41;</span>log4net.<span class="me1">LogManager</span>.<span class="me1">GetRepository</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">Logger rootLogger <span class="sy0">=</span> h.<span class="me1">Root</span>;</div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.danidemi.com/mainwww/2010/03/obtain-the-root-logger-programmatically-in-log4net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Good environment variable values during iPhone development</title>
		<link>http://www.danidemi.com/mainwww/2010/01/iphone_development_environment_variables/</link>
		<comments>http://www.danidemi.com/mainwww/2010/01/iphone_development_environment_variables/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 15:06:39 +0000</pubDate>
		<dc:creator>danidemi</dc:creator>
				<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[snippet]]></category>

		<guid isPermaLink="false">http://www.danidemi.com/mainwww/?p=94</guid>
		<description><![CDATA[<p>Directly from GHUnit, a small note about which environment variables to set while developing for the iPhone.</p>
Environment Variable:                 Default:  Set to:
NSDebugEnabled                  [...]]]></description>
			<content:encoded><![CDATA[<p>Directly from <a href="http://github.com/gabriel/gh-unit" target="_blank">GHUnit</a>, a small note about which environment variables to set while developing for the iPhone.</p>
<pre><code>Environment Variable:                 Default:  Set to:
NSDebugEnabled                           NO       YES
NSZombieEnabled                          NO       YES
NSDeallocateZombies                      NO       NO (or YES)
NSHangOnUncaughtException                NO       YES
NSAutoreleaseFreedObjectCheckEnabled     NO       YES
</code></pre>
<p>Actually, I keep forgetting them, so I hope this will be useful to me.</p>
<p>Here an example that shows how to set those environment variables.</p>
<div id="attachment_152" class="wp-caption aligncenter" style="width: 770px"><a href="http://www.danidemi.com/mainwww/wp-content/uploads/2010/03/variables.png"><img class="size-full wp-image-152" title="Setting iPhone development variables" src="http://www.danidemi.com/mainwww/wp-content/uploads/2010/03/variables.png" alt="" width="760" height="512" /></a><p class="wp-caption-text">Setting iPhone development variables in XCode</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.danidemi.com/mainwww/2010/01/iphone_development_environment_variables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails ans SQLite3 on Ubuntu</title>
		<link>http://www.danidemi.com/mainwww/2009/12/rails-ans-sqlite3-on-ubuntu/</link>
		<comments>http://www.danidemi.com/mainwww/2009/12/rails-ans-sqlite3-on-ubuntu/#comments</comments>
		<pubDate>Sat, 26 Dec 2009 10:06:37 +0000</pubDate>
		<dc:creator>danidemi</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[db]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[snippet]]></category>

		<guid isPermaLink="false">http://www.danidemi.com/mainwww/?p=90</guid>
		<description><![CDATA[<p>To configure a Rails application in order to use SQLite3 please follow the following steps:</p>
sudo apt-get install  sqlite3 swig libsqlite3-ruby libsqlite3-dev
 sudo gem install sqlite3-ruby
<p>Then create a Rails application as usual and update the environment.rb file in the following way</p>
Rails::Initializer.run do &#124;config&#124;
...
config.gem 'sqlite3-ruby', :lib =&#62; "sqlite3"
...
end
]]></description>
			<content:encoded><![CDATA[<p>To configure a Rails application in order to use SQLite3 please follow the following steps:</p>
<pre>sudo apt-get install  sqlite3 swig libsqlite3-ruby libsqlite3-dev
 sudo gem install sqlite3-ruby</pre>
<p>Then create a Rails application as usual and update the environment.rb file in the following way</p>
<pre>Rails::Initializer.run do |config|</pre>
<pre>...</pre>
<pre>config.gem 'sqlite3-ruby', :lib =&gt; "sqlite3"</pre>
<pre>...</pre>
<pre>end</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.danidemi.com/mainwww/2009/12/rails-ans-sqlite3-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get rid of folder that should not be versioned</title>
		<link>http://www.danidemi.com/mainwww/2009/12/get-rid-of-folder-that-should-not-be-versioned/</link>
		<comments>http://www.danidemi.com/mainwww/2009/12/get-rid-of-folder-that-should-not-be-versioned/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 10:01:55 +0000</pubDate>
		<dc:creator>danidemi</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[revision control]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://www.danidemi.com/mainwww/?p=88</guid>
		<description><![CDATA[<p>If you work with subversion, for sure you had the problem to tell to subversion to ignore a folder inside your working copy. This happens for example if your IDE builds the sources in a folder inside your working copy. From the very first commit you&#8217;ll start noticing that subversion wants to add that &#8220;build&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>If you work with subversion, for sure you had the problem to tell to subversion to ignore a folder inside your working copy. This happens for example if your IDE builds the sources in a folder inside your working copy. From the very first commit you&#8217;ll start noticing that subversion wants to add that &#8220;build&#8221; folder to your repository. But, obviously, this is not a good practice.</p>
<p>So you can tell subversion to ignore a folder. Just move in the folder that contains the folder you want to be ignored by subversion and type the following command.</p>
<pre>svn propset svn:ignore &lt;dir_you_want_to_be_ignored&gt; .</pre>
<p>The &#8220;dot&#8221; at the end is important! It means you&#8217;re specifying which folders of the current folder you want to be ignored.</p>
<p>Please note that &lt;dir_you_want_to_be_ignored&gt; should be written without trailing slashes. So for example if you want the build directory not to be managed by subversion, type&#8230;</p>
<pre>svn propset svn:ignore build .</pre>
<p>And not&#8230;</p>
<pre>
<pre>svn propset svn:ignore build/ .</pre>
</pre>
<p>This is a quick tip. I always forget how to do it, so I wrote that little note.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.danidemi.com/mainwww/2009/12/get-rid-of-folder-that-should-not-be-versioned/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chosing the number of decimal digits when printing a number with iPhone</title>
		<link>http://www.danidemi.com/mainwww/2009/11/chosing-the-number-of-decimal-digits-when-printing-a-number-with-iphone/</link>
		<comments>http://www.danidemi.com/mainwww/2009/11/chosing-the-number-of-decimal-digits-when-printing-a-number-with-iphone/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 11:39:59 +0000</pubDate>
		<dc:creator>danidemi</dc:creator>
				<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[snippet]]></category>

		<guid isPermaLink="false">http://www.danidemi.com/mainwww/?p=67</guid>
		<description><![CDATA[<p>This is a small snippet, useful whenever you want to convert a floating point number in a string with a fixed number of decimal digits.</p>
NSNumberFormatter *format = [NSNumberFormatter new];
 [format setMaximumFractionDigits:1];
 NSNumber *aNumber = [[NSNumber alloc ] initWithDouble:54.4235264];
 NSString label = [[NSString alloc] initWithFormat:@"The number is %@", [format stringForObjectValue:aNumber]];
 [distance release];
 [format release];
<p>Obviously the NSNumberFormatter [...]]]></description>
			<content:encoded><![CDATA[<p>This is a small snippet, useful whenever you want to convert a floating point number in a string with a fixed number of decimal digits.</p>
<pre>NSNumberFormatter *format = [NSNumberFormatter new];
 [format setMaximumFractionDigits:1];
 NSNumber *aNumber = [[NSNumber alloc ] initWithDouble:54.4235264];
 NSString label = [[NSString alloc] initWithFormat:@"The number is %@", [format stringForObjectValue:aNumber]];
 [distance release];
 [format release];</pre>
<p>Obviously the <a href="http://developer.apple.com/iphone/library/documentation/cocoa/reference/foundation/Classes/NSNumberFormatter_Class/Reference/Reference.html#//apple_ref/occ/cl/NSNumberFormatter" target="_blank">NSNumberFormatter</a> class offers plenty of other method you can use to customize the way your numbers should be rendered.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.danidemi.com/mainwww/2009/11/chosing-the-number-of-decimal-digits-when-printing-a-number-with-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
