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

<channel>
	<title>Marco Barisione's Weblog &#187; collabora</title>
	<atom:link href="http://blog.barisione.org/category/collabora/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.barisione.org</link>
	<description></description>
	<pubDate>Fri, 09 Jul 2010 09:55:37 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Custom ringtones for your contacts</title>
		<link>http://blog.barisione.org/2010-07/custom-ringtones-for-your-contacts/</link>
		<comments>http://blog.barisione.org/2010-07/custom-ringtones-for-your-contacts/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 08:02:51 +0000</pubDate>
		<dc:creator>barisione</dc:creator>
		
		<category><![CDATA[collabora]]></category>

		<category><![CDATA[maemo]]></category>

		<category><![CDATA[contacts]]></category>

		<category><![CDATA[custom ringtones]]></category>

		<category><![CDATA[fremantle]]></category>

		<category><![CDATA[n900]]></category>

		<category><![CDATA[ringtones]]></category>

		<guid isPermaLink="false">http://blog.barisione.org/?p=349</guid>
		<description><![CDATA[Yesterday I finished implementing the first release of a new program (ringtoned, i.e. ringtone daemon, i.e. I don&#8217;t have any imagination for program names) that allows setting a custom ringtone for specific contacts. Ringtoned tries to integrate nicely with the system:

You can select the default ringtone in Settings → Profiles as usual
To set a custom [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I finished implementing the first release of a new program (ringtoned, i.e. ringtone daemon, i.e. I don&#8217;t have any imagination for program names) that allows setting a custom ringtone for specific contacts. Ringtoned tries to integrate nicely with the system:</p>
<ul>
<li>You can select the default ringtone in Settings → Profiles as usual</li>
<li>To set a custom ringtone you go to the Contacts application, select the contact and press the new “Set custom ringtone” button in the menu</li>
<li>The dialog to set custom ringtones tries to be a perfect copy of the dialog to set the global ringtone</li>
<li>It works both for normal phone calls and GTalk/SIP/Skype calls, thanks to <a href="http://telepathy.freedesktop.org/wiki/">Telepathy</a></li>
<li>The ringtone is played only when the normal one would be played and at the same volume, thanks to some <a href="http://www.pulseaudio.org/">PulseAudio</a> magic</li>
</ul>
<p>Ringtoned also <em>tries</em> not to break your phone, if for any reasons it crashes the default behaviour <em>should</em> be restored. Nevertheless, this is just version 0.1, so it could be full of bugs and could make you miss phone calls. You have been warned! Moreover, replacing the default ringtone components with something more complex could make the ringtone start slightly later in case of heavy load, see <a href="http://blog.barisione.org/2010-07/how-hard-can-it-be/">my previous blog post</a>. You have been warned again!</p>
<p>If you still want to give it a try, ringtoned is now in <a href="http://wiki.maemo.org/Extras-devel">Maemo extras-devel</a> under the name “Custom ringtones for your contacts”. If you don&#8217;t want to add the extras-devel repository (as it contains a lot of unstable software), you can download ringtoned directly from my personal repository:</p>
<p align="center" class="img"><a href="http://people.collabora.co.uk/~bari/maemo/per-contact-ringtones.install"><img src="http://people.collabora.co.uk/~bari/maemo/ac_install_icon.png" style="border:0px" alt="Install per-contact-ringtones" /></a><br /><small><a href="http://people.collabora.co.uk/~bari/maemo/per-contact-ringtones.install">Install from my personal repository</a><br />(follow the link on the N900 browser)</small></p>
<p>If you are interested in the source code, it&#8217;s in <a href="http://git.collabora.co.uk/?p=user/bari/ringtoned.git;a=summary">Collabora&#8217;s git repositories</a>.</p>
<p>The are two major features that are missing at the moment: the ability to set a custom ringtone for anonymous phone calls and for calls from an unknown number, and the ability to set ringtones for groups and not only for single contacts. The former feature should be easy and it mainly just requires some UI, so it will be hopefully implemented shortly.<br />
Groups are more difficult to implement because they are not supported at all by the Maemo address book; I would first have to implement support for groups and then add ringtones for the groups. I hope to be able to find time for this, but I cannot guarantee anything.</p>
<p>In a future post I will explain the architecture of ringtoned and how to extend it: the code that chooses the custom ringtone is actually just a small plugin of the ringtone daemon and it&#8217;s possible to write other similar plugins for different needs.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.barisione.org/2010-07/custom-ringtones-for-your-contacts/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How hard can it be? (Or why you don&#8217;t have custom per contact ringtones on Maemo)</title>
		<link>http://blog.barisione.org/2010-07/how-hard-can-it-be/</link>
		<comments>http://blog.barisione.org/2010-07/how-hard-can-it-be/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 19:42:46 +0000</pubDate>
		<dc:creator>barisione</dc:creator>
		
		<category><![CDATA[collabora]]></category>

		<category><![CDATA[maemo]]></category>

		<category><![CDATA[community]]></category>

		<category><![CDATA[fremantle]]></category>

		<category><![CDATA[n900]]></category>

		<category><![CDATA[rant]]></category>

		<category><![CDATA[ringtones]]></category>

		<guid isPermaLink="false">http://blog.barisione.org/?p=335</guid>
		<description><![CDATA[Often in blogs, forums or IRC you can find people complaining of missing features in some programs (and some of them are very rude). While they can be right some times, other times they just make me angry because they don&#8217;t know how difficult writing software can be, and they don&#8217;t understand the difference between [...]]]></description>
			<content:encoded><![CDATA[<p>Often in blogs, forums or IRC you can find people complaining of missing features in some programs (<a href="http://www.penny-arcade.com/comic/2004/03/19/">and some of them are very rude</a>). While they can be right some times, other times they just make me angry because they don&#8217;t know how difficult writing software can be, and they don&#8217;t understand the difference between a semi-working prototype and a proper stable application written by professional developers, designed by professional UI designers and tested by professional testers.</p>
<p>Implementing some features can actually be quite difficult and it could be better to skip those from your product and focus on other things; on the N900 one of these missing features is the ability to set customised ringtones for specific contacts.<br />
Several people wondered how hard it can be, after all a lot of old phones do it. What they don&#8217;t consider is that, in many ways, the N900 is not a traditional phone and is more similar to a small computer. On the other hand, the N900 still needs to be reliable to be certified as a phone; for ringtones this means that the ringtone should be played as soon as the phone call is received, or the user could miss it.<br />
Now suppose your N900 is under heavy load due to multitasking (<em>real</em> multitasking, like on a normal computer) and you receive a phone call from a friend; being a close friend that often calls you, you have an MP3 ringtone set just for him. The phone has to look up for the contact corresponding to the phone number, load the file from the (slow) memory card, load the libraries for playing the ringtone, uncompress the file, and finally play it. All of this on a phone under heavy load with most programs swapped out of memory!<br />
To workaround this problem the N900 <abbr title="I never worked on this part of Maemo and I never saw the code, so I just know what I discovered by myself">seems</abbr> to do some tricks: the ringtone is uncompressed into a (big) WAV file and saved on the faster (but small) internal memory, and the component playing the ringtone is memlocked (i.e. never removed from memory). Of course, you cannot do this for all the possible ringtones or the already small disk space would be used immediately. Choosing not to uncompress the files, on the other hand, would mean keeping loaded in memory all the possible codecs.</p>
<p>Does this mean that it&#8217;s impossible to have a different ringtone for a specific contact on Maemo? No, it just means that if you want it you have to be ready to accept that the ringtone could start playing a couple of seconds later in some <em>uncommon</em> heavy load conditions. When you are ready to do that you just have to wait a couple of days, so that I can polish and publish the program I wrote to have custom ringtones <img src="http://farm1.static.flickr.com/205/458651139_21126b48de_o.png" alt=":D" /></p>
<p>In other news, I&#8217;m going to GUADEC for the whole week: see you there!</p>
<p align="center" class="img"><a href="http://www.guadec.org/"><img src="http://www.guadec.org/img/guadec-oranje.png" alt="I'm going to GUADEC" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.barisione.org/2010-07/how-hard-can-it-be/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Contacts merger in Maemo extras</title>
		<link>http://blog.barisione.org/2010-06/contacts-merger-in-maemo-extras/</link>
		<comments>http://blog.barisione.org/2010-06/contacts-merger-in-maemo-extras/#comments</comments>
		<pubDate>Sun, 20 Jun 2010 12:55:40 +0000</pubDate>
		<dc:creator>barisione</dc:creator>
		
		<category><![CDATA[collabora]]></category>

		<category><![CDATA[maemo]]></category>

		<category><![CDATA[address book]]></category>

		<category><![CDATA[contacts]]></category>

		<category><![CDATA[contacts merger]]></category>

		<category><![CDATA[extras]]></category>

		<category><![CDATA[fremantle]]></category>

		<category><![CDATA[merger]]></category>

		<category><![CDATA[n900]]></category>

		<guid isPermaLink="false">http://blog.barisione.org/?p=328</guid>
		<description><![CDATA[Just a quick post to inform the N900 users that didn&#8217;t enable the extras-devel or extras-testing repositories that the contacts merger has been promoted to Maemo extras. Just look for “Merge your duplicate contacts” in the application manager and enjoy 
]]></description>
			<content:encoded><![CDATA[<p>Just a quick post to inform the N900 users that didn&#8217;t enable the extras-devel or extras-testing repositories that the contacts merger has been promoted to Maemo extras. Just look for “Merge your duplicate contacts” in the application manager and enjoy <img src="http://farm1.static.flickr.com/189/458651157_780851832e_o.png" alt=":)" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.barisione.org/2010-06/contacts-merger-in-maemo-extras/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Handling phone numbers</title>
		<link>http://blog.barisione.org/2010-06/handling-phone-numbers/</link>
		<comments>http://blog.barisione.org/2010-06/handling-phone-numbers/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 07:21:51 +0000</pubDate>
		<dc:creator>barisione</dc:creator>
		
		<category><![CDATA[collabora]]></category>

		<category><![CDATA[maemo]]></category>

		<category><![CDATA[contacts]]></category>

		<category><![CDATA[phone numbers]]></category>

		<guid isPermaLink="false">http://blog.barisione.org/?p=312</guid>
		<description><![CDATA[I&#8217;m often asked questions about the handling and parsing of phone numbers, so I&#8217;m going to explain how we do it on Maemo 5. I hope this can be useful also for developers of other applications.
There is no unique standardised way to write phone numbers; in the UK the phone number of the Buckingham Palace [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m often asked questions about the handling and parsing of phone numbers, so I&#8217;m going to explain how we do it on Maemo 5. I hope this can be useful also for developers of other applications.</p>
<p>There is no unique standardised way to write phone numbers; in the UK the phone number of the Buckingham Palace Visitor Office can be written as 02073212233, <abbr title="This is a common but wrong way to indicate that the “0” can be omitted if the international prefix is used">+44 (0)20 7321 2233</abbr>, 0044 207 321 2233, etc. If you omit the international prefix +44, the number 02073212233 could be used by somebody else in another country, for instance to me it looks like a phone number for somebody living in Milan.</p>
<p>When storing a phone number you should keep it as you got it, including spaces, parenthesis, etc.<br />
When you want to use the number you should drop all the useless characters, but keep the extensions numbers. For instance 44-555-P1 would become 44555P1, which means: call the Vodafone UK balance information number 44555, pause for some seconds waiting for the recorded voice to start speaking, and send a 1 (i.e. ask for a text message with the remaining minutes for this month).</p>
<p>When comparing phone numbers to see if they belong to the same contact you also want to strip all the extra digits sent after a pause as those are not really part of the phone number. At this point you still have to somehow handle the craziness of international and local prefixes, for instance all these numbers <em>could</em> be a valid way to call the same person in <a href="http://en.wikipedia.org/wiki/San_Marino">San Marino</a>: <span title="Calling from Italy or San Marino">0549 123 456</span>, <span title="Calling from anywhere using the San Marino calling code (+378)">+378 0549 123 456</span>, <span title="Calling from anywhere using the Italian calling code (+39)">+39 0549 123 456</span>, <span title="Calling from a country where the international call prefix is 00">0039 0549 123 456</span>, <span title="Calling from a country where the international call prefix is 011, like the US">011 39 0549 123 456</span>.<br />
How do phones handle this? Just by comparing the last 7 digits of the phone number, that is the minimum length used <a href="https://bugs.maemo.org/show_bug.cgi?id=7227#c8" title="Bugs happening only in Qatar for the win!">somewhere</a> for phone numbers.<br />
This of course leaves a chance of false matches, but as you can see there is no real generic solution for this.</p>
<p>Here&#8217;s some code to show how to handle phone numbers. I used Python as a sort of pseudo-language, so I preferred readability for non-Python developers over good pythonic code.</p>
<pre>
extension_chars <span style='color:#808030; '>=</span> <span style='color:#808030; '>(</span><span style='color:#0000e6; '>'p'</span><span style='color:#808030; '>,</span> <span style='color:#0000e6; '>'P'</span><span style='color:#808030; '>,</span> <span style='color:#0000e6; '>'w'</span><span style='color:#808030; '>,</span> <span style='color:#0000e6; '>'W'</span><span style='color:#808030; '>,</span> <span style='color:#0000e6; '>'x'</span><span style='color:#808030; '>,</span> <span style='color:#0000e6; '>'X'</span><span style='color:#808030; '>)</span>

<span style='color:#800000; font-weight:bold; '>def</span> normalize_phone_number<span style='color:#808030; '>(</span>number<span style='color:#808030; '>)</span><span style='color:#808030; '>:</span>
    common_delimiters <span style='color:#808030; '>=</span> <span style='color:#808030; '>(</span><span style='color:#0000e6; '>','</span><span style='color:#808030; '>,</span> <span style='color:#0000e6; '>'.'</span><span style='color:#808030; '>,</span> <span style='color:#0000e6; '>'('</span><span style='color:#808030; '>,</span> <span style='color:#0000e6; '>')'</span><span style='color:#808030; '>,</span> <span style='color:#0000e6; '>'-'</span><span style='color:#808030; '>,</span> <span style='color:#0000e6; '>' '</span><span style='color:#808030; '>,</span>
                         <span style='color:#0000e6; '>'\t'</span><span style='color:#808030; '>,</span> <span style='color:#0000e6; '>'/'</span><span style='color:#808030; '>)</span>
    valid_digits <span style='color:#808030; '>=</span> <span style='color:#808030; '>(</span><span style='color:#0000e6; '>'#'</span><span style='color:#808030; '>,</span> <span style='color:#0000e6; '>'*'</span><span style='color:#808030; '>,</span> <span style='color:#0000e6; '>'0'</span><span style='color:#808030; '>,</span> <span style='color:#0000e6; '>'1'</span><span style='color:#808030; '>,</span> <span style='color:#0000e6; '>'2'</span><span style='color:#808030; '>,</span> <span style='color:#0000e6; '>'3'</span><span style='color:#808030; '>,</span> <span style='color:#0000e6; '>'4'</span><span style='color:#808030; '>,</span>
                    <span style='color:#0000e6; '>'5'</span><span style='color:#808030; '>,</span> <span style='color:#0000e6; '>'6'</span><span style='color:#808030; '>,</span> <span style='color:#0000e6; '>'7'</span><span style='color:#808030; '>,</span> <span style='color:#0000e6; '>'8'</span><span style='color:#808030; '>,</span> <span style='color:#0000e6; '>'9'</span><span style='color:#808030; '>)</span>

    normalized <span style='color:#808030; '>=</span> <span style='color:#0000e6; '>''</span>

    <span style='color:#800000; font-weight:bold; '>for</span> digit <span style='color:#800000; font-weight:bold; '>in</span> number<span style='color:#808030; '>:</span>
        <span style='color:#800000; font-weight:bold; '>if</span> digit <span style='color:#800000; font-weight:bold; '>in</span> extension_chars<span style='color:#808030; '>:</span>
            <span style='color:#696969; '># Keep the extension characters P, W and X,</span>
            <span style='color:#696969; '># but be sure they are upper case.</span>
            digit <span style='color:#808030; '>=</span> digit<span style='color:#808030; '>.</span>upper<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span>
        <span style='color:#800000; font-weight:bold; '>elif</span> digit <span style='color:#808030; '>=</span><span style='color:#808030; '>=</span> <span style='color:#0000e6; '>'+'</span><span style='color:#808030; '>:</span>
            <span style='color:#696969; '># "+" is valid only at the beginning of phone</span>
            <span style='color:#696969; '># numbers or after the number suppression</span>
            <span style='color:#696969; '># prefix. (No idea why we support only this</span>
            <span style='color:#696969; '># GSM code, but not the VSC ones.)</span>
            <span style='color:#800000; font-weight:bold; '>if</span> normalized <span style='color:#800000; font-weight:bold; '>not</span> <span style='color:#800000; font-weight:bold; '>in</span> <span style='color:#808030; '>(</span><span style='color:#0000e6; '>''</span><span style='color:#808030; '>,</span> <span style='color:#0000e6; '>'*31#'</span><span style='color:#808030; '>,</span> <span style='color:#0000e6; '>'#31#'</span><span style='color:#808030; '>)</span><span style='color:#808030; '>:</span>
                <span style='color:#800000; font-weight:bold; '>print</span> <span style='color:#0000e6; '>'Wrong "+" in "%s"'</span> <span style='color:#808030; '>%</span> number
                <span style='color:#696969; '># Skip this "+".</span>
                <span style='color:#800000; font-weight:bold; '>continue</span>
        <span style='color:#800000; font-weight:bold; '>elif</span> digit <span style='color:#800000; font-weight:bold; '>in</span> common_delimiters<span style='color:#808030; '>:</span>
            <span style='color:#696969; '># Skip this delimiter.</span>
            <span style='color:#800000; font-weight:bold; '>continue</span>
        <span style='color:#800000; font-weight:bold; '>elif</span> digit <span style='color:#800000; font-weight:bold; '>in</span> valid_digits<span style='color:#808030; '>:</span>
            <span style='color:#696969; '># Ok, let's keep it.</span>
            <span style='color:#800000; font-weight:bold; '>pass</span>
        <span style='color:#800000; font-weight:bold; '>else</span><span style='color:#808030; '>:</span>
            <span style='color:#696969; '># What is this? It doesn't seem valid but we</span>
            <span style='color:#696969; '># just keep it</span>
            <span style='color:#800000; font-weight:bold; '>print</span> <span style='color:#0000e6; '>'Unknown character "%s" in "%s"'</span> <span style='color:#808030; '>%</span> \
                    <span style='color:#808030; '>(</span>digit<span style='color:#808030; '>,</span> number<span style='color:#808030; '>)</span>

        normalized <span style='color:#808030; '>+</span><span style='color:#808030; '>=</span> digit

    <span style='color:#800000; font-weight:bold; '>return</span> normalized

<span style='color:#800000; font-weight:bold; '>def</span> remove_extension_chars<span style='color:#808030; '>(</span>number<span style='color:#808030; '>)</span><span style='color:#808030; '>:</span>
    clean <span style='color:#808030; '>=</span> <span style='color:#0000e6; '>''</span>

    <span style='color:#800000; font-weight:bold; '>for</span> digit <span style='color:#800000; font-weight:bold; '>in</span> number<span style='color:#808030; '>:</span>
        <span style='color:#800000; font-weight:bold; '>if</span> digit <span style='color:#800000; font-weight:bold; '>in</span> extension_chars<span style='color:#808030; '>:</span>
            <span style='color:#696969; '># Extension character, drop this character and</span>
            <span style='color:#696969; '># the rest of the string.</span>
            <span style='color:#800000; font-weight:bold; '>break</span>

        clean <span style='color:#808030; '>+</span><span style='color:#808030; '>=</span> digit

    <span style='color:#800000; font-weight:bold; '>return</span> clean

<span style='color:#800000; font-weight:bold; '>def</span> phone_numbers_equal<span style='color:#808030; '>(</span>number1<span style='color:#808030; '>,</span> number2<span style='color:#808030; '>)</span><span style='color:#808030; '>:</span>
    number1 <span style='color:#808030; '>=</span> normalize_phone_number<span style='color:#808030; '>(</span>number1<span style='color:#808030; '>)</span>
    number1 <span style='color:#808030; '>=</span> remove_extension_chars<span style='color:#808030; '>(</span>number1<span style='color:#808030; '>)</span>

    number2 <span style='color:#808030; '>=</span> normalize_phone_number<span style='color:#808030; '>(</span>number2<span style='color:#808030; '>)</span>
    number2 <span style='color:#808030; '>=</span> remove_extension_chars<span style='color:#808030; '>(</span>number2<span style='color:#808030; '>)</span>

    <span style='color:#696969; '># Compare only the last 7 digits.</span>
    <span style='color:#696969; '># If one of the numbers is shorter than 7 digits it's</span>
    <span style='color:#696969; '># important that the comparison is done on the full</span>
    <span style='color:#696969; '># length of the numbers and not only on the last tiny</span>
    <span style='color:#696969; '># bits of the 2 numbers.</span>
    <span style='color:#800000; font-weight:bold; '>return</span> number1<span style='color:#808030; '>[</span><span style='color:#808030; '>-</span><span style='color:#008c00; '>7</span><span style='color:#808030; '>:</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span><span style='color:#808030; '>=</span> number2<span style='color:#808030; '>[</span><span style='color:#808030; '>-</span><span style='color:#008c00; '>7</span><span style='color:#808030; '>:</span><span style='color:#808030; '>]</span>
</pre>
<p align="center" class="img"><small>Python code for handling phone numbers<br /><a href="http://people.collabora.co.uk/~bari/phone.py">(Download the full code with tests)</a></small></p>
<p>If you are handling phone numbers on Maemo 5, there are already some useful functions to use: <a href="http://maemo.org/api_refs/5.0/5.0-final/libebook/libebook-e-book-util.html#e-normalize-phone-number">e_&#8203;normalize_&#8203;phone_&#8203;number</a>, <a href="http://maemo.org/api_refs/5.0/5.0-final/libosso-abook/libosso-abook-osso-abook-util.html#osso-abook-phone-numbers-equal">osso_&#8203;abook_&#8203;phone_&#8203;numbers_&#8203;equal</a>, <a href="http://maemo.org/api_refs/5.0/5.0-final/libosso-abook/OssoABookContact.html#osso-abook-contact-matches-phone-number">osso_&#8203;abook_&#8203;contact_&#8203;matches_&#8203;phone_&#8203;number</a> and <a href="http://maemo.org/api_refs/5.0/5.0-final/libosso-abook/libosso-abook-osso-abook-util.html#osso-abook-query-phone-number">osso_&#8203;abook_&#8203;query_&#8203;phone_&#8203;number</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.barisione.org/2010-06/handling-phone-numbers/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Contacts merger 0.1.3 in Maemo extras-testing</title>
		<link>http://blog.barisione.org/2010-06/contacts-merger-013-in-maemo-extras/</link>
		<comments>http://blog.barisione.org/2010-06/contacts-merger-013-in-maemo-extras/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 20:47:46 +0000</pubDate>
		<dc:creator>barisione</dc:creator>
		
		<category><![CDATA[collabora]]></category>

		<category><![CDATA[maemo]]></category>

		<category><![CDATA[address book]]></category>

		<category><![CDATA[contacts]]></category>

		<category><![CDATA[contacts merger]]></category>

		<category><![CDATA[fremantle]]></category>

		<category><![CDATA[merger]]></category>

		<category><![CDATA[n900]]></category>

		<guid isPermaLink="false">http://blog.barisione.org/?p=306</guid>
		<description><![CDATA[Since my previous post about the contacts merger, I fixed a crash, made it handle better broken vcards, improved the partial matching and made the installer quit the address book when the plugin is installed, so no reboot is needed.
The new 0.1.3 merger is now available in Maemo extras-testing, just look for “Merge your duplicate [...]]]></description>
			<content:encoded><![CDATA[<p>Since my <a href="http://blog.barisione.org/2010-06/finding-the-duplicate-contacts-in-your-address-book/">previous post about the contacts merger</a>, I fixed a crash, made it handle better broken vcards, improved the partial matching and made the installer quit the address book when the plugin is installed, so no reboot is needed.<br />
The new 0.1.3 merger is now available in <a href="http://wiki.maemo.org/Extras-testing">Maemo extras-testing</a>, just look for “Merge your duplicate contacts” in the application manager.</p>
<h4>What&#8217;s next</h4>
<p>Suppose I <em>could</em> have some spare time to write some <em>small</em> applications relating to the N900 address book; what would you want me to work on? The application should be small and not require changes to the closed source components. Suggestions are welcome in the comments, but I cannot assure you anything <img src="http://farm1.static.flickr.com/189/458651157_780851832e_o.png" alt=":)" /></p>
<p><small><b>Update:</b> I meant extras-testing of course, not extras</small></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.barisione.org/2010-06/contacts-merger-013-in-maemo-extras/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Finding duplicate contacts in your address book</title>
		<link>http://blog.barisione.org/2010-06/finding-the-duplicate-contacts-in-your-address-book/</link>
		<comments>http://blog.barisione.org/2010-06/finding-the-duplicate-contacts-in-your-address-book/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 08:21:20 +0000</pubDate>
		<dc:creator>barisione</dc:creator>
		
		<category><![CDATA[collabora]]></category>

		<category><![CDATA[maemo]]></category>

		<category><![CDATA[address book]]></category>

		<category><![CDATA[contacts]]></category>

		<category><![CDATA[contacts merger]]></category>

		<category><![CDATA[fremantle]]></category>

		<category><![CDATA[merger]]></category>

		<category><![CDATA[n900]]></category>

		<guid isPermaLink="false">http://blog.barisione.org/?p=299</guid>
		<description><![CDATA[One of the common complaints about the Maemo address book is that it&#8217;s easy to get a lot of duplicate contacts as the address book is able to pull your contacts from various IM services. From the beginning there has been a way to merge duplicates, but it meant manually going through all of your [...]]]></description>
			<content:encoded><![CDATA[<p>One of the common complaints about the Maemo address book is that it&#8217;s easy to get a lot of duplicate contacts as the address book is able to pull your contacts from various IM services. From the beginning there has been a way to merge duplicates, but it meant manually going through all of your contacts hunting down the duplicates.<br />
Today I finished writing the first version of a program that tries to automatically detect duplicates based on the IM names, emails, phone numbers and names. Of course this is just based on heuristics; you still have to go through the list and select the contacts that you want to merge. You can find this utility under the name “Merge your duplicate contacts” in the application manager and it&#8217;s available in <a href="http://wiki.maemo.org/Extras-devel#How_to_activate_Extras-devel">Maemo extras-devel</a>. Remember that extras-devel contains unstable software: enable it only if you really know what you are doing!<br />
After installing Contacts Merger you have to reboot your phone<sup>[1]</sup> and then you will get a “Find duplicate contacts” button in the menu of the main address book window.</p>
<p align="centre" class="img"><a href="http://farm5.static.flickr.com/4010/4667729768_034435a3d0_b.jpg"><img src="http://farm5.static.flickr.com/4010/4667729768_034435a3d0_b.jpg" alt="The window suggesting the possible merges" class="scaled" width="400" /></a><br /><small>The window suggesting the possible merges</small></p>
<p><b>Update:</b> I released 0.1.1 that fixes a crasher in case of malformed contacts.</p>
<p><b>Update 2:</b> Forgot to say <a href="http://git.collabora.co.uk/?p=user/bari/contacts-merger.git;a=summary">where to get the code</a>.</p>
<p><small><b>[1]</b> Sadly the address book doesn&#8217;t automatically load newly installed plugins without a restart; see <a href="https://bugs.maemo.org/show_bug.cgi?id=10542" alt="Maemo bugzilla: Reboot needed after installing the contacts merger">bug #10542</a>.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.barisione.org/2010-06/finding-the-duplicate-contacts-in-your-address-book/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Plugins for the N900 address book</title>
		<link>http://blog.barisione.org/2010-05/plugins-for-the-n900-address-book/</link>
		<comments>http://blog.barisione.org/2010-05/plugins-for-the-n900-address-book/#comments</comments>
		<pubDate>Tue, 25 May 2010 16:06:48 +0000</pubDate>
		<dc:creator>barisione</dc:creator>
		
		<category><![CDATA[collabora]]></category>

		<category><![CDATA[maemo]]></category>

		<category><![CDATA[address book]]></category>

		<category><![CDATA[contacts]]></category>

		<category><![CDATA[fremantle]]></category>

		<category><![CDATA[n900]]></category>

		<category><![CDATA[plugins]]></category>

		<guid isPermaLink="false">http://blog.barisione.org/?p=294</guid>
		<description><![CDATA[Finally the new update for Maemo 5 is out; it&#8217;s good to see that months of bug fixes and new features are finally available to everybody! One of the new features, not directly visible to users, is that developers can now add new buttons to the Contacts application menu. At the beginning we wanted to [...]]]></description>
			<content:encoded><![CDATA[<p>Finally the new update for Maemo 5 is out; it&#8217;s good to see that months of bug fixes and new features are finally available to everybody! One of the new features, not directly visible to users, is that developers can now add new buttons to the Contacts application menu. At the beginning we wanted to make the plugin system more powerful, but sadly it required too many changes and we didn&#8217;t have enough time to finish and test it properly.</p>
<p align="centre" class="img"><a href="http://farm5.static.flickr.com/4005/4638741953_03df615705_o.png"><img src="http://farm5.static.flickr.com/4005/4638741953_03df615705_o.png" alt="A “Hello World” button added by the example plugin" class="scaled" width="400" /></a><br /><small>A “Hello World” button added by the example plugin</small></p>
<p>To add new buttons you have to create a new object that derives from <code>OssoABookMenuExtension</code> and implements the required methods. For an example of this, see the <a href="http://maemo.gitorious.org/osso-abook-plugin-example/osso-abook-plugin-example">example on gitorious</a> that <a href="http://taschenorakel.de/mathias/">Mathias</a> wrote and the <a href="http://maemo.org/api_refs/5.0/5.0-final/libosso-abook/OssoABookMenuExtension.html">API documentation</a>.<br />
Please, don&#8217;t go crazy with this new feature and don&#8217;t add 2000 different buttons to the menu!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.barisione.org/2010-05/plugins-for-the-n900-address-book/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Merge back your Facebook contacts</title>
		<link>http://blog.barisione.org/2010-05/merge-back-your-facebook-contacts/</link>
		<comments>http://blog.barisione.org/2010-05/merge-back-your-facebook-contacts/#comments</comments>
		<pubDate>Thu, 20 May 2010 20:21:50 +0000</pubDate>
		<dc:creator>barisione</dc:creator>
		
		<category><![CDATA[collabora]]></category>

		<category><![CDATA[maemo]]></category>

		<category><![CDATA[address book]]></category>

		<category><![CDATA[facebook]]></category>

		<category><![CDATA[fremantle]]></category>

		<category><![CDATA[n900]]></category>

		<guid isPermaLink="false">http://blog.barisione.org/?p=282</guid>
		<description><![CDATA[As I said in my previous blog post, some changes in the Facebook XMPP servers lead to the unmerging of the Facebook contacts that were merged with local contacts in the N900 address book. To fix this problem I wrote the small utility Facebook migrator, now available in Maemo extras-testing, that automatically merges back your [...]]]></description>
			<content:encoded><![CDATA[<p>As I said in <a href="http://blog.barisione.org/2010-05/facebook-and-the-n900-address-book/">my previous blog post</a>, some changes in the Facebook XMPP servers lead to the unmerging of the Facebook contacts that were merged with local contacts in the N900 address book. To fix this problem I wrote the small utility Facebook migrator, now available in <a href="http://wiki.maemo.org/Extras-testing">Maemo extras-testing</a>, that automatically merges back your contacts. Please remember that extras-testing contains unstable software and mine is not an exception! The source code is available on the <a href="http://git.collabora.co.uk/?p=user/bari/fb-migrator.git;a=summary">Collabora git repositories</a>.</p>
<p>If you have any feedback, please let me know in the comments to this post. The only known issue at the moment is that saving your contacts is quite slow, but I didn&#8217;t bother making it fast considering that it&#8217;s just a one time operation.</p>
<h3>Wordpress troubles</h3>
<p>In other news, I noticed that I don&#8217;t get an email notification anymore when somebody comments on my blog, but a simple PHP script that uses the <code>mail()</code> function sends emails correctly. In the logs I don&#8217;t see anything useful and I&#8217;m sure the notifications are not in the spam folder. Does anybody have any suggestion on how to debug this?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.barisione.org/2010-05/merge-back-your-facebook-contacts/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Facebook and the N900 address book</title>
		<link>http://blog.barisione.org/2010-05/facebook-and-the-n900-address-book/</link>
		<comments>http://blog.barisione.org/2010-05/facebook-and-the-n900-address-book/#comments</comments>
		<pubDate>Thu, 13 May 2010 16:46:23 +0000</pubDate>
		<dc:creator>barisione</dc:creator>
		
		<category><![CDATA[collabora]]></category>

		<category><![CDATA[maemo]]></category>

		<category><![CDATA[address book]]></category>

		<category><![CDATA[facebook]]></category>

		<category><![CDATA[fremantle]]></category>

		<category><![CDATA[n900]]></category>

		<guid isPermaLink="false">http://blog.barisione.org/?p=275</guid>
		<description><![CDATA[The N900 address book can merge multiple contacts into a single entity: if you have a friend that has a phone number, an email address, a Jabber user name, a MSN one and so on, then you can merge all of the different entities into a single meta-contact.
Locally stored details and an IM user name [...]]]></description>
			<content:encoded><![CDATA[<p>The N900 address book can merge multiple contacts into a single entity: if you have a friend that has a phone number, an email address, a Jabber user name, a MSN one and so on, then you can merge all of the different entities into a single meta-contact.</p>
<p align="centre" class="img"><a href="http://farm4.static.flickr.com/3525/4031796040_62de75ded3_o.png"><img src="http://farm4.static.flickr.com/3525/4031796040_62de75ded3_o.png" alt="Locally stored details and an IM user name in the same contact" class="scaled" /></a><br /><small>Locally stored details and an IM user name in the same contact</small></p>
<p>The different IM contacts are tracked through their username and should be immutable<sup><small>[1]</small></sup>, but yesterday Facebook changed all the IDs from something like “u123456789@chat.facebook.com” to “-123456789@chat.facebook.com”. For the address book this means that all the previous contacts were deleted from the IM roster and new contacts were added, so you get duplicate contacts. Moreover, when a contact is removed from the roster we leave the IM user name in the contact details, if you click the button you can add the contact back to one of your rosters. In the Facebook case this means that you end up with all of your meta-contacts with a useless button that cannot do nothing.</p>
<p>The fix for this is to remove the old IDs and merge your contacts again, simple but tedious. A better way to do it is to be patient and wait until I finish a program that will do it for you in a few click <img src="http://farm1.static.flickr.com/218/458651141_54bbc48288_o.png" alt=";)" /></p>
<p><b>Update:</b> I finished and release the program, see <a href="http://blog.barisione.org/2010-05/merge-back-your-facebook-contacts/">my blog post about Facebook migrator</a>.</p>
<p><small>[1] Actually, some changes in the IDs are possible for normalisation purposes; if you add “FooBar@example.COM” it will become “foobar@example.com” in your roster. (And yes, the normalisation is buggy in PR1.1, but it will be fixed in PR1.2.)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.barisione.org/2010-05/facebook-and-the-n900-address-book/feed/</wfw:commentRss>
		</item>
		<item>
		<title>GTK surprises on Maemo</title>
		<link>http://blog.barisione.org/2010-05/gtk-surprises-on-maemo/</link>
		<comments>http://blog.barisione.org/2010-05/gtk-surprises-on-maemo/#comments</comments>
		<pubDate>Tue, 04 May 2010 08:07:44 +0000</pubDate>
		<dc:creator>barisione</dc:creator>
		
		<category><![CDATA[collabora]]></category>

		<category><![CDATA[maemo]]></category>

		<category><![CDATA[address book]]></category>

		<category><![CDATA[callgrind]]></category>

		<category><![CDATA[contacts]]></category>

		<category><![CDATA[gtk]]></category>

		<category><![CDATA[GtkTreeView]]></category>

		<category><![CDATA[kcachegrind]]></category>

		<category><![CDATA[n900]]></category>

		<category><![CDATA[valgrind]]></category>

		<guid isPermaLink="false">http://blog.barisione.org/?p=259</guid>
		<description><![CDATA[Sometimes the creation of the contact chooser used on the N900 can be slow so, using callgrind and kcachegrind, I tried to understand what is the source of the slowness. This lead me to find some unexpected, and apparently undocumented, differences between upstream GTK and the Maemo version.
The Maemo 5 contact chooser
The widget contains a [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes the creation of the contact chooser used on the N900 can be slow so, using callgrind and kcachegrind, I tried to understand what is the source of the slowness. This lead me to find some unexpected, and apparently undocumented, differences between upstream GTK and the Maemo version.</p>
<p align="centre" class="img"><a href="http://farm5.static.flickr.com/4012/4576575676_7c4bee3997_o.png"><img src="http://farm5.static.flickr.com/4012/4576575676_7c4bee3997_o.png" alt="The Maemo 5 contact chooser" class="scaled" /></a><br /><small>The Maemo 5 contact chooser</small></p>
<p>The widget contains a GtkTreeView that uses a model with just one column for the contact objects. How can its creation be so slow? To my surprise most of the time was spent decompressing the avatar images!<br />
The avatars of the contacts are loaded, scaled and cropped in the <a href="http://library.gnome.org/devel/gtk/stable/GtkTreeViewColumn.html#gtk-tree-view-column-set-cell-data-func">cell data function</a> of the GtkTreeViewColumn as, for various reasons, we cannot cache on disk the resulting image or generate it before the creation of the widget. Following calls of the cell data function for the same row won&#8217;t need to generate the avatar anymore. Doing non-trivial operations in the cell data function is not the nicest thing to do, but this should not be a problem as the cell data function is called only for the visible rows, right? No, at least not on Maemo!<br />
To verify it just try <a href="http://people.collabora.co.uk/~bari/tmp/cell-test.c">this example program</a>: on Maemo the <code>cell_func()</code> function is called once per item in the model plus once per visible item, elsewhere only once per visible item.</p>
<p>After a bit of investigation together with <a href="http://people.gnome.org/~csaavedra/">Claudio</a>, we discovered that on Maemo there is a function called <code>gtk_&#8203tree_&#8203view_&#8203column_&#8203get_&#8203cell_&#8203data_&#8203hint()</code> that returns <code>GTK_&#8203TREE_&#8203CELL_&#8203DATA_&#8203HINT_&#8203KEY_&#8203FOCUS</code>, <code>GTK_&#8203TREE_&#8203CELL_&#8203DATA_&#8203HINT_&#8203SENSITIVITY</code> or <code>GTK_&#8203TREE_&#8203CELL_&#8203DATA_&#8203HINT_&#8203ALL</code>. The hint tells you why the function was called; in the example code the function is called on the hidden rows only to get their sensitivity so there is no need to set the “<code>pixbuf</code>” property of the cell at this point.</p>
<p>Just this tiny change in the address book code makes the contact chooser open much faster if you have a lot of contacts with big avatars, like the ones that <a href="http://hermes.garage.maemo.org/">Hermes</a> creates. On the other hand the delayed loading made the scrolling become non-smooth <img src="http://farm1.static.flickr.com/217/458651161_e4a46b807b_o.png" alt=":(" /><br />
To fix the scrolling I had to implement some asynchronous loading of the avatars. The contact chooser now tries to load as many avatars as possible in idle moments and also tries to load first the avatars for the contacts that the user is more likely to see. The results seem quite good; now the contact list is fast, scrolling is smooth and the delayed loading of avatars should not be visible in normal cases.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.barisione.org/2010-05/gtk-surprises-on-maemo/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
