<?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>Flavio Castelli &#187; Howto</title>
	<atom:link href="http://flavio.castelli.name/category/howto/feed" rel="self" type="application/rss+xml" />
	<link>http://flavio.castelli.name</link>
	<description>debugging my life</description>
	<lastBuildDate>Wed, 11 Aug 2010 20:29:29 +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>Updated git-svn howto</title>
		<link>http://flavio.castelli.name/updated-git-svn-howto</link>
		<comments>http://flavio.castelli.name/updated-git-svn-howto#comments</comments>
		<pubDate>Fri, 23 Nov 2007 14:49:12 +0000</pubDate>
		<dc:creator>Flavio</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[KDE]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Site news]]></category>
		<category><![CDATA[]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://www.flavio.castelli.name/updated-git-svn-howto</guid>
		<description><![CDATA[Maybe someone has already experimented this situation: You&#8217;re hacking on your local working copy and you want to keep it up-to-date but, since you have some uncommitted changes, git-svn rebase cannot be executed I was just thinking to write something about this problem when I read a post on digikam blog. In this post Marcel [...]]]></description>
			<content:encoded><![CDATA[<p>Maybe someone has already experimented this situation:</p>
<blockquote><p>You&#8217;re hacking on your local working copy and you want to keep it up-to-date but, since you have some uncommitted changes, <em>git-svn rebase</em> cannot be executed</p></blockquote>
<p>I was just thinking to write something about<em> </em>this problem when I read a <a href="http://www.digikam.org/?q=node/270">post</a> on digikam blog.</p>
<p>In this post Marcel proposes a workaround using a bash function. In fact there&#8217;s a <em>&#8220;cleaner&#8221;</em> solution, if you&#8217;re interested read the last part of my <a href="http://www.flavio.castelli.name/howto_use_git_with_svn">git-svn howto</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://flavio.castelli.name/updated-git-svn-howto/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Howto use Git and svn together</title>
		<link>http://flavio.castelli.name/howto_use_git_with_svn</link>
		<comments>http://flavio.castelli.name/howto_use_git_with_svn#comments</comments>
		<pubDate>Tue, 04 Sep 2007 11:22:15 +0000</pubDate>
		<dc:creator>Flavio</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[KDE]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.flavio.castelli.name/howto_use_git_with_svn/</guid>
		<description><![CDATA[In these days I&#8217;ve heard lot of rumors around Git. After reading some manual/tutorial/guide I discovered that it can be really useful, especially if you spend lot of time coding off-line (that&#8217;s my situation). This is a really small howto that describes how to work on a project versioned with svn (maybe taken from KDE [...]]]></description>
			<content:encoded><![CDATA[<p>In these days I&#8217;ve heard lot of rumors around <a href="http://git.or.cz/">Git</a>. After reading some manual/tutorial/guide I discovered that it can be really useful, especially if you spend lot of time coding off-line (that&#8217;s my situation).</p>
<p>This is a really small howto that describes how to work on a project versioned with svn (maybe taken from KDE repository <img src='http://flavio.castelli.name/wp-content/plugins/smilies-themer/tango/face-wink.png' alt=';)' class='wp-smiley' /> ) using git.</p>
<p><span id="more-7"></span></p>
<h3>What&#8217;re the advantages?</h3>
<p>Since Git is a distributed revision control system (while svn is a centralized one) you can perform commits, brances, merges,&#8230; on your local working dir without being connected to internet.</p>
<p>Next time you&#8217;ll be online, you will be able to <em>&#8220;push&#8221;</em> your changes back to the central svn server.</p>
<h3>Steps to follow:</h3>
<p>You&#8217;ve to:</p>
<ol>
<li>install <em>git</em> and <em>git-svn</em></li>
<li>create the working dir: <code>mkdir strigi</code></li>
<li>init your git working dir:<br />
<code>cd strigi &amp;&amp; git-svn init https://svn.kde.org/home/kde/trunk/kdesupport/strigi</code><br />
<em>git-svn init</em> command is followed by the address of the svn repository (in this case we point to strigi&#8217;s repository)</li>
<li>Find a commit regarding the project (you can get it from <a href="http://cia.vc/">cia version control</a>). <strong>Warning:</strong> the command <em>git-log</em> will show project&#8217;s history starting from this revision.</li>
<li>Perform the command <code>git-svn fetch -rREVISION</code><br />
Where <em>REVISION</em> is the number obtained before.</li>
<li>Update your working dir: <code>git-svn rebase</code></li>
</ol>
<p>Now you&#8217;ll be able to work on your project using git as revision control system.</p>
<p>To <strong>keep update</strong> your working copy just perform:</p>
<p><code>git-svn rebase</code></p>
<p>You can <strong>commit your changes </strong> to the svn server using the command:</p>
<p><code>git-svn dcommit</code></p>
<p>In this way each commit made with git will be <em>&#8220;transformed&#8221;</em> into a svn one.</p>
<h3>Solve git-svn rebase problems</h3>
<p>While adding new cool features to your program, you may experiment some problem when synchronizing with the main development tree. In fact you have to commit all local modifications (using the <code>git-commit</code> command) before invoking <code>git-svn rebase</code>.</p>
<p>Sometimes it isn&#8217;t reasonable since your changes are not yet ready to be committed (you haven&#8217;t finished/tested/improved your work). But don&#8217;t worry, git has a native solution also for this problem, just follow these steps:</p>
<ol>
<li>put aside your changes using the command: <code>git-stash</code></li>
<li>update your working copy using: <code>git-svn rebase</code> as usual</li>
<li>take back your changes typing: <code>git-stash apply</code></li>
<li>clear <em>&#8220;the stash&#8221;</em> typing: <code>git-stash clear</code></li>
</ol>
<p>After the first step all your uncommitted changes will disappear from the working copy, so you&#8217;ll be able to perform the rebase command without problems.</p>
<p>For further informations read <code>git-stash</code> man page.</p>
<p>That&#8217;s all.</p>
<p><strong>Greetings:</strong> I would like to thank Thiago Macieira for his help.</p>
]]></content:encoded>
			<wfw:commentRss>http://flavio.castelli.name/howto_use_git_with_svn/feed</wfw:commentRss>
		<slash:comments>42</slash:comments>
		</item>
		<item>
		<title>iBook X keyboard mapping</title>
		<link>http://flavio.castelli.name/ibook-x-keyboard-mapping</link>
		<comments>http://flavio.castelli.name/ibook-x-keyboard-mapping#comments</comments>
		<pubDate>Fri, 12 May 2006 17:09:06 +0000</pubDate>
		<dc:creator>Flavio</dc:creator>
				<category><![CDATA[Howto]]></category>

		<guid isPermaLink="false">http://www.flavio.castelli.name/ibook-x-keyboard-mapping/</guid>
		<description><![CDATA[How to have a comfortable keyboard layout under X. A guide destinated to italian iBook linux users Target have the following keymap: apple keyboard = alt gr Instructions You&#8217;ve to edit your /etc/X11/xkb/keycodes/xfree86 file. Remember to make a backup copy of this file before editing. These&#8217;re the easy steps: under X run a program like [...]]]></description>
			<content:encoded><![CDATA[<p>How to have a comfortable keyboard layout under X.<br />
A guide  destinated to italian iBook linux users<br />
<span id="more-34"></span></p>
<h3>Target</h3>
<p>have the following keymap:<br />
<code>apple keyboard = alt gr</code></p>
<h3>Instructions</h3>
<p>You&#8217;ve to edit your <code>/etc/X11/xkb/keycodes/xfree86</code> file. Remember to make a backup copy of this file before editing.<br />
These&#8217;re the easy steps: </p>
<ul>
<li>under X run a program like xev to find the exact keycode of your apple key</li>
<li>change the <RALT> code with the new one</li>
<li>comment all the old command referring the new keycode </li>
</ul>
<p>Restart X and keep your finger crossed <img src='http://flavio.castelli.name/wp-content/plugins/smilies-themer/tango/face-wink.png' alt=';)' class='wp-smiley' /> </p>
<h3>Configuration file</h3>
<p>Here&#8217;s my xfree86 file, you can try it if you&#8217;ve an iBook with an italian keyboard</p>
]]></content:encoded>
			<wfw:commentRss>http://flavio.castelli.name/ibook-x-keyboard-mapping/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iBook console keyboard mapping</title>
		<link>http://flavio.castelli.name/ibook-console-keyboard-mapping</link>
		<comments>http://flavio.castelli.name/ibook-console-keyboard-mapping#comments</comments>
		<pubDate>Fri, 12 May 2006 11:05:14 +0000</pubDate>
		<dc:creator>Flavio</dc:creator>
				<category><![CDATA[Howto]]></category>

		<guid isPermaLink="false">http://www.flavio.castelli.name/ibook-console-keyboard-mapping/</guid>
		<description><![CDATA[How to have a comfortable italian keyboard layout on your iBook. Target We just want this mapping: apple key = alt gr numpad return (the key near to left arrow) = canc Procedure Simply download the file at the end of the page and load it using loadkeys ibook-it.map.gz Simple, isn&#8217;t it? Download I found [...]]]></description>
			<content:encoded><![CDATA[<p>How to have a comfortable italian keyboard layout on your iBook.<br />
<!-- mroe--></p>
<h3>Target</h3>
<p>We just want this mapping:</p>
<pre>
<code>apple key = alt gr
numpad return (the key near to left arrow) = canc</code></pre>
<h3>Procedure</h3>
<p>Simply download the file at the end of the page and load it using<br />
<code>loadkeys  ibook-it.map.gz</code></p>
<p>Simple, isn&#8217;t it?</p>
<h3>Download</h3>
<p>I found this file over internet, the author is  Dario Besseghini. Thank you Dario!<br />
<a href="http://www.flavio.castelli.name/wp-content/uploads/2007/11/ibook-itmap.gz" title="iBook console keyboard mapping">iBook console keyboard mapping</a></p>
]]></content:encoded>
			<wfw:commentRss>http://flavio.castelli.name/ibook-console-keyboard-mapping/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iBook mouse emulation</title>
		<link>http://flavio.castelli.name/ibook-mouse-emulation</link>
		<comments>http://flavio.castelli.name/ibook-mouse-emulation#comments</comments>
		<pubDate>Fri, 05 May 2006 11:07:21 +0000</pubDate>
		<dc:creator>Flavio</dc:creator>
				<category><![CDATA[Howto]]></category>

		<guid isPermaLink="false">http://www.flavio.castelli.name/ibook-mouse-emulation/</guid>
		<description><![CDATA[In this really small guide you&#8217;ll discover howto enable mouse button emulation on a iBook G4 running linux Target: I just wanted to enable mouse button emulation on my iBook using the following shortcuts: fn + ctrl = middle mouse button fn + alt = left mouse button Requisites: You&#8217;ve to enable CONFIG_MAC_EMUMOUSEBTN in your [...]]]></description>
			<content:encoded><![CDATA[<p>In this really small guide you&#8217;ll discover howto enable mouse button emulation on a iBook G4 running linux<br />
<span id="more-33"></span></p>
<h3>Target:</h3>
<p>I just wanted to enable mouse button emulation on my iBook using the following shortcuts:</p>
<pre><code>fn + ctrl = middle mouse button
fn + alt = left mouse button</code></pre>
<h3>Requisites:</h3>
<p>You&#8217;ve to enable <code>CONFIG_MAC_EMUMOUSEBTN</code> in your kernel.</p>
<h3>Commands:</h3>
<p>In order to enable this shortcut at every boot add the following lines to your <code>/etc/sysctl.conf</code>:</p>
<pre><code>dev.mac_hid.mouse_button_emulation = 1
dev.mac_hid.mouse_button2_keycode = 97
dev.mac_hid.mouse_button3_keycode = 100</code></pre>
<p>Simple, isn&#8217;t it?</p>
]]></content:encoded>
			<wfw:commentRss>http://flavio.castelli.name/ibook-mouse-emulation/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Regexp with boost</title>
		<link>http://flavio.castelli.name/regexp-with-boost</link>
		<comments>http://flavio.castelli.name/regexp-with-boost#comments</comments>
		<pubDate>Thu, 16 Feb 2006 11:42:50 +0000</pubDate>
		<dc:creator>Flavio</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.flavio.castelli.name/regexp-with-boost/</guid>
		<description><![CDATA[How can you add regular expressions to C++? Here you&#8217;re three small examples. Pattern matching In this example you&#8217;ll find how you can match a regexp in a string. // Created by Flavio Castelli &#60;flavio.castelli_AT_gmail.com&#62; // distrubuted under GPL v2 license #include &#60;boost/regex.hpp&#62; #include &#60;string&#62; int main() { boost::regex pattern ("bg&#124;olug",boost::regex_constants::icase&#124;boost::regex_constants::perl); std::string stringa ("Searching for [...]]]></description>
			<content:encoded><![CDATA[<p><strong>How can you add regular expressions to C++?</strong><br />
Here you&#8217;re three small examples.<br />
<span id="more-45"></span></p>
<h3>Pattern matching</h3>
<p>In this example you&#8217;ll find how you can match a regexp in a string.</p>
<pre>
<code>// Created by Flavio Castelli &lt;flavio.castelli_AT_gmail.com&gt;
// distrubuted under GPL v2 license

#include &lt;boost/regex.hpp&gt;
#include &lt;string&gt;

int main()
{
	boost::regex pattern ("bg|olug",boost::regex_constants::icase|boost::regex_constants::perl);
	std::string stringa ("Searching for BsLug");

	if (boost::regex_search (stringa, pattern, boost::regex_constants::format_perl))
		printf ("found\n");
	else
		printf("not found\n");
		
	return 0;
}</code>
</pre>
<h3>Substitutions</h3>
<p>In this example you&#8217;ll find how you can replace a string matching a pattern.</p>
<pre>
<code>// Created by Flavio Castelli &lt;flavio.castelli@gmail.com&gt;
// distrubuted under GPL v2 license

#include &lt;boost/regex.hpp&gt;
#include &lt;string&gt;

int main()
{
	boost::regex pattern ("b.lug",boost::regex_constants::icase|boost::regex_constants::perl);
	std::string stringa ("Searching for bolug");
	std::string replace ("BgLug");
	std::string newString;

	newString = boost::regex_replace (stringa, pattern, replace);

	printf("The new string is: |%s|\n",newString.c_str());
		
	return 0;
}</code>
</pre>
<h3>Split</h3>
<p>In this example you&#8217;ll find how you tokenize a string with a pattern.</p>
<pre>
<code>// Created by Flavio Castelli &lt;flavio.castelli@gmail.com&gt;
// distrubuted under GPL v2 license

#include &lt;boost/regex.hpp&gt;
#include &lt;string&gt;

int main()
{
	boost::regex pattern ("\\D",boost::regex_constants::icase|boost::regex_constants::perl);
	
	std::string stringa ("26/11/2005 17:30");
	std::string temp;
	
	boost::sregex_token_iterator i(stringa.begin(), stringa.end(), pattern, -1);
	boost::sregex_token_iterator j;

	unsigned int counter = 0;
	
	while(i != j)
	{
		temp = *i;
		printf ("token %i = |%s|\n", ++counter, temp.c_str());
		i++;
	}

	return 0;
}</code>
</pre>
<h3>Requirements</h3>
<p>In order to build this examples you&#8217;ll need: </p>
<ul>
<li>a c++ compiler (like g++)</li>
<li><a href="http://www.boost.org/libs/regex/doc/index.html">boost regexp library</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://flavio.castelli.name/regexp-with-boost/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
