<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" xml:lang="en" xml:base="http://blog.mro.name/wp-atom.php">
	<title type="text">MRo Blog</title>
	<subtitle type="text">Marcus Rohrmoser mobile Software</subtitle>

	<updated>2011-08-09T20:55:27Z</updated>

	<link rel="alternate" type="text/html" href="http://blog.mro.name" />
	<id>http://blog.mro.name/feed/atom/</id>
	

	<generator uri="http://wordpress.org/" version="3.3.1">WordPress</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/MRO-Blog" /><feedburner:info uri="mro-blog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><link rel="license" type="text/html" href="http://creativecommons.org/licenses/by-sa/3.0/" /><logo>http://creativecommons.org/images/public/somerights20.gif</logo><entry>
		<author>
			<name>Marcus Rohrmoser</name>
						<uri>http://blog.mro.name</uri>
					</author>
		<title type="html"><![CDATA[Rank sql(ite) text search results]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MRO-Blog/~3/4sXkOTSM6qQ/" />
		<id>http://blog.mro.name/?p=2208</id>
		<updated>2011-08-09T20:55:27Z</updated>
		<published>2011-08-05T06:48:19Z</published>
		<category scheme="http://blog.mro.name" term="Articles in english" /><category scheme="http://blog.mro.name" term="development" /><category scheme="http://blog.mro.name" term="iOS" /><category scheme="http://blog.mro.name" term="iPhone" /><category scheme="http://blog.mro.name" term="like" /><category scheme="http://blog.mro.name" term="Search" /><category scheme="http://blog.mro.name" term="SQL" /><category scheme="http://blog.mro.name" term="SQLite" />		<summary type="html"><![CDATA[When searching for text snippets in sql databases you might want to rank the results according to "how good did it match". And: the ranking shouldn't make the query slower.

Let's take a simple example using the LIKE operator. (I know, FTS does a better job, but let's stick to like for now).

Assume the search ...]]></summary>
		<content type="html" xml:base="http://blog.mro.name/2011/08/rank-sqlite-text-search-results/">&lt;p&gt;When searching for text snippets in sql databases you might want to rank the results according to &amp;#8220;how good did it match&amp;#8221;. And: the ranking shouldn&amp;#8217;t make the query slower.&lt;/p&gt;
&lt;p&gt;Let&amp;#8217;s take a simple example using the &lt;a href="http://www.sqlite.org/lang_expr.html#like"&gt;LIKE operator&lt;/a&gt;. (I know, &lt;a href="http://blog.mro.name/2010/03/iphone-sqlite-fulltext-index/"&gt;FTS&lt;/a&gt; does a better job, but let&amp;#8217;s stick to like for now).&lt;/p&gt;
&lt;p&gt;Assume the search expression &amp;#8216;a bc de&amp;#8217; and a table &amp;#8216;my_table&amp;#8217; with text columns &amp;#8216;title&amp;#8217; and &amp;#8216;description&amp;#8217;.&lt;/p&gt;
&lt;p&gt;We want to find all rows with &amp;#8216;title&amp;#8217; matching all three blank-separated parts of the search term:&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="sql" style="font-family:monospace;"&gt;&lt;span style="color: #993333; font-weight: bold;"&gt;SELECT&lt;/span&gt; rowid&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; title
&lt;span style="color: #993333; font-weight: bold;"&gt;FROM&lt;/span&gt; my_table
&lt;span style="color: #993333; font-weight: bold;"&gt;WHERE&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;title &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;'%a%'&lt;/span&gt; &lt;span style="color: #993333; font-weight: bold;"&gt;AND&lt;/span&gt; title &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;'%bc%'&lt;/span&gt; &lt;span style="color: #993333; font-weight: bold;"&gt;AND&lt;/span&gt; title &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;'%de%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;To sort them, we apply a bonus for parts matching the column start&lt;/strong&gt;:&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="sql" style="font-family:monospace;"&gt;&lt;span style="color: #993333; font-weight: bold;"&gt;SELECT&lt;/span&gt; rowid&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; title&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt;
    &lt;span style="color: #808080; font-style: italic;"&gt;-- column start bonus&lt;/span&gt;
    &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;'a%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; title&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;+&lt;/span&gt;
    &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;'bc%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; title&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;+&lt;/span&gt;
    &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;'de%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; title&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;+&lt;/span&gt;
&lt;span style="color: #cc66cc;"&gt;0&lt;/span&gt; &lt;span style="color: #993333; font-weight: bold;"&gt;AS&lt;/span&gt; bonus
&lt;span style="color: #993333; font-weight: bold;"&gt;FROM&lt;/span&gt; my_table
&lt;span style="color: #993333; font-weight: bold;"&gt;WHERE&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;title &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;'%a%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #993333; font-weight: bold;"&gt;AND&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;title &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;'%bc%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #993333; font-weight: bold;"&gt;AND&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;title &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;'%de%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;
&lt;span style="color: #993333; font-weight: bold;"&gt;ORDER&lt;/span&gt; &lt;span style="color: #993333; font-weight: bold;"&gt;BY&lt;/span&gt; bonus &lt;span style="color: #993333; font-weight: bold;"&gt;DESC&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; title &lt;span style="color: #993333; font-weight: bold;"&gt;ASC&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; rowid &lt;span style="color: #993333; font-weight: bold;"&gt;ASC&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Next, we&amp;#8217;d like to add a (somewhat smaller) &lt;strong&gt;bonus for word-starts&lt;/strong&gt;:&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="sql" style="font-family:monospace;"&gt;&lt;span style="color: #993333; font-weight: bold;"&gt;SELECT&lt;/span&gt; rowid&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; title&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt;
    &lt;span style="color: #808080; font-style: italic;"&gt;-- column start bonus&lt;/span&gt;
    &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;'a%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; title&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;*&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;2&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;+&lt;/span&gt;
    &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;'bc%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; title&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;*&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;2&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;+&lt;/span&gt;
    &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;'de%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; title&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;*&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;2&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;+&lt;/span&gt;
    &lt;span style="color: #808080; font-style: italic;"&gt;-- word start bonus&lt;/span&gt;
    &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;'% a%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; title&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;*&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;1&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;+&lt;/span&gt;
    &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;'% bc%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; title&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;*&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;1&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;+&lt;/span&gt;
    &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;'% de%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; title&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;*&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;1&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;+&lt;/span&gt;
&lt;span style="color: #cc66cc;"&gt;0&lt;/span&gt; &lt;span style="color: #993333; font-weight: bold;"&gt;AS&lt;/span&gt; bonus
&lt;span style="color: #993333; font-weight: bold;"&gt;FROM&lt;/span&gt; my_table
&lt;span style="color: #993333; font-weight: bold;"&gt;WHERE&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;title &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;'%a%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #993333; font-weight: bold;"&gt;AND&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;title &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;'%bc%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #993333; font-weight: bold;"&gt;AND&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;title &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;'%de%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;
&lt;span style="color: #993333; font-weight: bold;"&gt;ORDER&lt;/span&gt; &lt;span style="color: #993333; font-weight: bold;"&gt;BY&lt;/span&gt; bonus &lt;span style="color: #993333; font-weight: bold;"&gt;DESC&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; title &lt;span style="color: #993333; font-weight: bold;"&gt;ASC&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; rowid &lt;span style="color: #993333; font-weight: bold;"&gt;ASC&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Rows &lt;strong&gt;matching the three terms in order&lt;/strong&gt; get an even bigger bonus:&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="sql" style="font-family:monospace;"&gt;&lt;span style="color: #993333; font-weight: bold;"&gt;SELECT&lt;/span&gt; rowid&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; title&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt;
    &lt;span style="color: #808080; font-style: italic;"&gt;-- correct order bonus&lt;/span&gt;
    &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;'%a%bc%de%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; title&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;*&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;5&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;*&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;3&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;+&lt;/span&gt;
    &lt;span style="color: #808080; font-style: italic;"&gt;-- column start bonus&lt;/span&gt;
    &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;'a%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; title&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;*&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;2&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;+&lt;/span&gt;
    &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;'bc%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; title&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;*&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;2&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;+&lt;/span&gt;
    &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;'de%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; title&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;*&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;2&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;+&lt;/span&gt;
    &lt;span style="color: #808080; font-style: italic;"&gt;-- word start bonus&lt;/span&gt;
    &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;'% a%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; title&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;*&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;1&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;+&lt;/span&gt;
    &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;'% bc%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; title&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;*&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;1&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;+&lt;/span&gt;
    &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;'% de%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; title&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;*&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;1&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;+&lt;/span&gt;
&lt;span style="color: #cc66cc;"&gt;0&lt;/span&gt; &lt;span style="color: #993333; font-weight: bold;"&gt;AS&lt;/span&gt; bonus
&lt;span style="color: #993333; font-weight: bold;"&gt;FROM&lt;/span&gt; my_table
&lt;span style="color: #993333; font-weight: bold;"&gt;WHERE&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;title &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;'%a%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #993333; font-weight: bold;"&gt;AND&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;title &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;'%bc%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #993333; font-weight: bold;"&gt;AND&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;title &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;'%de%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;
&lt;span style="color: #993333; font-weight: bold;"&gt;ORDER&lt;/span&gt; &lt;span style="color: #993333; font-weight: bold;"&gt;BY&lt;/span&gt; bonus &lt;span style="color: #993333; font-weight: bold;"&gt;DESC&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; title &lt;span style="color: #993333; font-weight: bold;"&gt;ASC&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; rowid &lt;span style="color: #993333; font-weight: bold;"&gt;ASC&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And finally adding the &lt;strong&gt;match on &amp;#8216;description&amp;#8217; secondary&lt;/strong&gt;:&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="sql" style="font-family:monospace;"&gt;&lt;span style="color: #993333; font-weight: bold;"&gt;SELECT&lt;/span&gt; rowid&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; title&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; description&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt;
    &lt;span style="color: #808080; font-style: italic;"&gt;-- title is primary match:&lt;/span&gt;
    &lt;span style="color: #808080; font-style: italic;"&gt;-- correct order bonus&lt;/span&gt;
    &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;'%a%bc%de%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; title&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;*&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;50&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;*&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;3&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;+&lt;/span&gt;
    &lt;span style="color: #808080; font-style: italic;"&gt;-- column start bonus&lt;/span&gt;
    &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;'a%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; title&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;*&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;20&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;+&lt;/span&gt;
    &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;'bc%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; title&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;*&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;20&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;+&lt;/span&gt;
    &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;'de%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; title&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;*&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;20&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;+&lt;/span&gt;
    &lt;span style="color: #808080; font-style: italic;"&gt;-- word start bonus&lt;/span&gt;
    &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;'% a%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; title&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;*&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;10&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;+&lt;/span&gt;
    &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;'% bc%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; title&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;*&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;10&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;+&lt;/span&gt;
    &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;'% de%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; title&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;*&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;10&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;+&lt;/span&gt;
    &lt;span style="color: #808080; font-style: italic;"&gt;-- description is secondary match:&lt;/span&gt;
    &lt;span style="color: #808080; font-style: italic;"&gt;-- correct order bonus&lt;/span&gt;
    &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;'%a%bc%de%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; description&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;*&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;5&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;*&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;3&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;+&lt;/span&gt;
    &lt;span style="color: #808080; font-style: italic;"&gt;-- column start bonus&lt;/span&gt;
    &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;'a%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; description&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;*&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;2&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;+&lt;/span&gt;
    &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;'bc%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; description&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;*&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;2&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;+&lt;/span&gt;
    &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;'de%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; description&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;*&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;2&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;+&lt;/span&gt;
    &lt;span style="color: #808080; font-style: italic;"&gt;-- word start bonus&lt;/span&gt;
    &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;'% a%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; description&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;*&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;1&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;+&lt;/span&gt;
    &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;'% bc%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; description&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;*&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;1&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;+&lt;/span&gt;
    &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;'% de%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; description&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;*&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;1&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;+&lt;/span&gt;
&lt;span style="color: #cc66cc;"&gt;0&lt;/span&gt; &lt;span style="color: #993333; font-weight: bold;"&gt;AS&lt;/span&gt; bonus
&lt;span style="color: #993333; font-weight: bold;"&gt;FROM&lt;/span&gt; my_table
&lt;span style="color: #993333; font-weight: bold;"&gt;WHERE&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;title       &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;'%a%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #993333; font-weight: bold;"&gt;AND&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;title       &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;'%bc%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #993333; font-weight: bold;"&gt;AND&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;title       &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;'%de%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;
&lt;span style="color: #993333; font-weight: bold;"&gt;OR&lt;/span&gt;    &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;description &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;'%a%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #993333; font-weight: bold;"&gt;AND&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;description &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;'%bc%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #993333; font-weight: bold;"&gt;AND&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;&amp;#40;&lt;/span&gt;description &lt;span style="color: #993333; font-weight: bold;"&gt;LIKE&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;'%de%'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;#41;&lt;/span&gt;
&lt;span style="color: #993333; font-weight: bold;"&gt;ORDER&lt;/span&gt; &lt;span style="color: #993333; font-weight: bold;"&gt;BY&lt;/span&gt; bonus &lt;span style="color: #993333; font-weight: bold;"&gt;DESC&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; title &lt;span style="color: #993333; font-weight: bold;"&gt;ASC&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; description &lt;span style="color: #993333; font-weight: bold;"&gt;ASC&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; rowid &lt;span style="color: #993333; font-weight: bold;"&gt;ASC&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You get the idea.&lt;/p&gt;
&lt;p&gt;Funny thing is &amp;#8211; the whole ranking logic doesn&amp;#8217;t hit performance (at least for small texts in the two columns)!&lt;/p&gt;
&lt;p&gt;So, key is:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;scan the table only once to find match candidates using the LIKE operator,&lt;/li&gt;
&lt;li&gt;use the LIKE function(!) plus weighting-factors to compute a bonus for each hit,&lt;/li&gt;
&lt;li&gt;evtl. add secondary matching columns.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;P.S.: This post was inspired by a chat with &lt;a href="http://leetr.com/"&gt;Deesa&lt;/a&gt; on the way home riding &lt;a href="http://www.granvilleislandferries.bc.ca/"&gt;False Creek Ferry&lt;/a&gt;.&lt;/p&gt;
&lt;p class="wp-flattr-button"&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://blog.mro.name/?flattrss_redirect&amp;amp;id=2208&amp;amp;md5=5937bffbea3fbc21966f481092426daf" title="Flattr" target="_blank"&gt;&lt;img src="http://blog.mro.name/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MRO-Blog/~4/4sXkOTSM6qQ" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://blog.mro.name/2011/08/rank-sqlite-text-search-results/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://blog.mro.name/2011/08/rank-sqlite-text-search-results/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://blog.mro.name/2011/08/rank-sqlite-text-search-results/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Marcus Rohrmoser</name>
						<uri>http://blog.mro.name</uri>
					</author>
		<title type="html"><![CDATA[Ruby: Simple Fast Fourier Transform]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MRO-Blog/~3/iu3bvbpyJBQ/" />
		<id>http://blog.mro.name/?p=2187</id>
		<updated>2011-04-05T00:40:11Z</updated>
		<published>2011-04-05T00:07:33Z</published>
		<category scheme="http://blog.mro.name" term="Articles in english" /><category scheme="http://blog.mro.name" term="development" /><category scheme="http://blog.mro.name" term="DFT" /><category scheme="http://blog.mro.name" term="DSP" /><category scheme="http://blog.mro.name" term="FFT" /><category scheme="http://blog.mro.name" term="Fourier" /><category scheme="http://blog.mro.name" term="Math" /><category scheme="http://blog.mro.name" term="Ruby" /><category scheme="http://blog.mro.name" term="Transform" />		<summary type="html"><![CDATA[by far not as powerful as the Fastest Fourier Transform in the West but maybe sometimes useful for a quick data analysis or de-noising. Reads stdin and writes to stdout.

Algorithm taken from Meyberg, Vachenauer: Höhere Mathematik II and ported to plain ruby myself.
< ![CDATA[ 
#!/usr/bin/env ruby
require 'complex'

class Array
	# DFT and inverse.
	# 
	# Algorithm from 
	# ...]]></summary>
		<content type="html" xml:base="http://blog.mro.name/2011/04/simple-ruby-fast-fourier-transform/">&lt;p&gt;by far not as powerful as the &lt;a title="FFTW" href="http://www.fftw.org/"&gt;Fastest Fourier Transform in the West&lt;/a&gt; but maybe sometimes useful for a quick data analysis or de-noising. Reads stdin and writes to stdout.&lt;/p&gt;
&lt;p&gt;Algorithm taken from &lt;a title="Meyberg, Vachenauer: Höhere Mathematik II" href="http://books.google.de/books?id=srRTakoleg0C&amp;amp;printsec=frontcover"&gt;Meyberg, Vachenauer: Höhere Mathematik II&lt;/a&gt; and ported to plain ruby myself.&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="ruby" style="font-family:monospace;"&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;lt;&lt;/span&gt; !&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#91;&lt;/span&gt;CDATA&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#91;&lt;/span&gt; 
&lt;span style="color:#008000; font-style:italic;"&gt;#!/usr/bin/env ruby&lt;/span&gt;
&lt;span style="color:#CC0066; font-weight:bold;"&gt;require&lt;/span&gt; &lt;span style="color:#996600;"&gt;'complex'&lt;/span&gt;
&amp;nbsp;
&lt;span style="color:#9966CC; font-weight:bold;"&gt;class&lt;/span&gt; &lt;span style="color:#CC0066; font-weight:bold;"&gt;Array&lt;/span&gt;
	&lt;span style="color:#008000; font-style:italic;"&gt;# DFT and inverse.&lt;/span&gt;
	&lt;span style="color:#008000; font-style:italic;"&gt;# &lt;/span&gt;
	&lt;span style="color:#008000; font-style:italic;"&gt;# Algorithm from &lt;/span&gt;
	&lt;span style="color:#008000; font-style:italic;"&gt;# 'Meyberg, Vachenauer: Hoehere Mathematik II, Springer Berlin, 1991, page 332'&lt;/span&gt;
	&lt;span style="color:#008000; font-style:italic;"&gt;#&lt;/span&gt;
	&lt;span style="color:#008000; font-style:italic;"&gt;# See http://blog.mro.name/2011/04/simple-ruby-fast-fourier-transform/ &lt;/span&gt;
	&lt;span style="color:#008000; font-style:italic;"&gt;#&lt;/span&gt;
	&lt;span style="color:#9966CC; font-weight:bold;"&gt;def&lt;/span&gt; fft doinverse = &lt;span style="color:#0000FF; font-weight:bold;"&gt;false&lt;/span&gt;
		src = &lt;span style="color:#0000FF; font-weight:bold;"&gt;self&lt;/span&gt;
		&lt;span style="color:#008000; font-style:italic;"&gt;# raise ArgumentError.new &amp;quot;Expected array input but was '#{src.class}'&amp;quot; unless src.kind_of? Array&lt;/span&gt;
		n = src.&lt;span style="color:#9900CC;"&gt;length&lt;/span&gt;
		nlog2 = &lt;span style="color:#CC00FF; font-weight:bold;"&gt;Math&lt;/span&gt;.&lt;span style="color:#9900CC;"&gt;log&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#40;&lt;/span&gt; n &lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color:#006600; font-weight:bold;"&gt;/&lt;/span&gt; &lt;span style="color:#CC00FF; font-weight:bold;"&gt;Math&lt;/span&gt;.&lt;span style="color:#9900CC;"&gt;log&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#40;&lt;/span&gt; &lt;span style="color:#006666;"&gt;2&lt;/span&gt; &lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#41;&lt;/span&gt;
		&lt;span style="color:#CC0066; font-weight:bold;"&gt;raise&lt;/span&gt; &lt;span style="color:#CC00FF; font-weight:bold;"&gt;ArgumentError&lt;/span&gt;.&lt;span style="color:#9900CC;"&gt;new&lt;/span&gt; &lt;span style="color:#996600;"&gt;&amp;quot;Input array size must be a power of two but was '#{n}'&amp;quot;&lt;/span&gt; &lt;span style="color:#9966CC; font-weight:bold;"&gt;unless&lt;/span&gt; nlog2.&lt;span style="color:#9900CC;"&gt;floor&lt;/span&gt; &lt;span style="color:#006600; font-weight:bold;"&gt;-&lt;/span&gt; nlog2 == &lt;span style="color:#006666;"&gt;0.0&lt;/span&gt;
		n2 = n &lt;span style="color:#006600; font-weight:bold;"&gt;/&lt;/span&gt; &lt;span style="color:#006666;"&gt;2&lt;/span&gt;
		phi = &lt;span style="color:#CC00FF; font-weight:bold;"&gt;Math&lt;/span&gt;::PI &lt;span style="color:#006600; font-weight:bold;"&gt;/&lt;/span&gt; n2
		&lt;span style="color:#9966CC; font-weight:bold;"&gt;if&lt;/span&gt; doinverse
			phi = &lt;span style="color:#006600; font-weight:bold;"&gt;-&lt;/span&gt;phi
		&lt;span style="color:#9966CC; font-weight:bold;"&gt;else&lt;/span&gt;
			src.&lt;span style="color:#9900CC;"&gt;collect&lt;/span&gt;!&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#123;&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;|&lt;/span&gt;c&lt;span style="color:#006600; font-weight:bold;"&gt;|&lt;/span&gt; c &lt;span style="color:#006600; font-weight:bold;"&gt;/&lt;/span&gt;= n.&lt;span style="color:#9900CC;"&gt;to_f&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#125;&lt;/span&gt;
		&lt;span style="color:#9966CC; font-weight:bold;"&gt;end&lt;/span&gt;
&amp;nbsp;
		&lt;span style="color:#008000; font-style:italic;"&gt;# build a sine/cosine table&lt;/span&gt;
		wt = &lt;span style="color:#CC0066; font-weight:bold;"&gt;Array&lt;/span&gt;.&lt;span style="color:#9900CC;"&gt;new&lt;/span&gt; n2
		wt.&lt;span style="color:#9900CC;"&gt;each_index&lt;/span&gt; &lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#123;&lt;/span&gt; &lt;span style="color:#006600; font-weight:bold;"&gt;|&lt;/span&gt;i&lt;span style="color:#006600; font-weight:bold;"&gt;|&lt;/span&gt; wt&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#91;&lt;/span&gt;i&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#93;&lt;/span&gt; = &lt;span style="color:#CC00FF; font-weight:bold;"&gt;Complex&lt;/span&gt;.&lt;span style="color:#9900CC;"&gt;new&lt;/span&gt; &lt;span style="color:#CC00FF; font-weight:bold;"&gt;Math&lt;/span&gt;.&lt;span style="color:#9900CC;"&gt;cos&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#40;&lt;/span&gt;i &lt;span style="color:#006600; font-weight:bold;"&gt;*&lt;/span&gt; phi&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#41;&lt;/span&gt;, &lt;span style="color:#CC00FF; font-weight:bold;"&gt;Math&lt;/span&gt;.&lt;span style="color:#9900CC;"&gt;sin&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#40;&lt;/span&gt;i &lt;span style="color:#006600; font-weight:bold;"&gt;*&lt;/span&gt; phi&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
		&lt;span style="color:#008000; font-style:italic;"&gt;# bit reordering&lt;/span&gt;
		n1 = n &lt;span style="color:#006600; font-weight:bold;"&gt;-&lt;/span&gt; &lt;span style="color:#006666;"&gt;1&lt;/span&gt;
		j = &lt;span style="color:#006666;"&gt;0&lt;/span&gt;
		&lt;span style="color:#006666;"&gt;1&lt;/span&gt;.&lt;span style="color:#9900CC;"&gt;upto&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#40;&lt;/span&gt;n1&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color:#9966CC; font-weight:bold;"&gt;do&lt;/span&gt; &lt;span style="color:#006600; font-weight:bold;"&gt;|&lt;/span&gt;i&lt;span style="color:#006600; font-weight:bold;"&gt;|&lt;/span&gt;
			m = n2
			&lt;span style="color:#9966CC; font-weight:bold;"&gt;while&lt;/span&gt; j &lt;span style="color:#006600; font-weight:bold;"&gt;&amp;gt;&lt;/span&gt;= m
				j &lt;span style="color:#006600; font-weight:bold;"&gt;-&lt;/span&gt;= m
				m &lt;span style="color:#006600; font-weight:bold;"&gt;/&lt;/span&gt;= &lt;span style="color:#006666;"&gt;2&lt;/span&gt;
			&lt;span style="color:#9966CC; font-weight:bold;"&gt;end&lt;/span&gt;
			j &lt;span style="color:#006600; font-weight:bold;"&gt;+&lt;/span&gt;= m
			src&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#91;&lt;/span&gt;i&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#93;&lt;/span&gt;,src&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#91;&lt;/span&gt;j&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#93;&lt;/span&gt; = src&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#91;&lt;/span&gt;j&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#93;&lt;/span&gt;,src&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#91;&lt;/span&gt;i&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#93;&lt;/span&gt; &lt;span style="color:#9966CC; font-weight:bold;"&gt;if&lt;/span&gt; j &lt;span style="color:#006600; font-weight:bold;"&gt;&amp;gt;&lt;/span&gt; i
		&lt;span style="color:#9966CC; font-weight:bold;"&gt;end&lt;/span&gt;
&amp;nbsp;
		&lt;span style="color:#008000; font-style:italic;"&gt;# 1d(N) Ueberlagerungen&lt;/span&gt;
		mm = &lt;span style="color:#006666;"&gt;1&lt;/span&gt;
		&lt;span style="color:#9966CC; font-weight:bold;"&gt;begin&lt;/span&gt;
			m = mm
			mm &lt;span style="color:#006600; font-weight:bold;"&gt;*&lt;/span&gt;= &lt;span style="color:#006666;"&gt;2&lt;/span&gt;
			&lt;span style="color:#006666;"&gt;0&lt;/span&gt;.&lt;span style="color:#9900CC;"&gt;upto&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#40;&lt;/span&gt;m &lt;span style="color:#006600; font-weight:bold;"&gt;-&lt;/span&gt; &lt;span style="color:#006666;"&gt;1&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color:#9966CC; font-weight:bold;"&gt;do&lt;/span&gt; &lt;span style="color:#006600; font-weight:bold;"&gt;|&lt;/span&gt;k&lt;span style="color:#006600; font-weight:bold;"&gt;|&lt;/span&gt;
				w = wt&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#91;&lt;/span&gt; k &lt;span style="color:#006600; font-weight:bold;"&gt;*&lt;/span&gt; n2 &lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#93;&lt;/span&gt;
				k.&lt;span style="color:#9900CC;"&gt;step&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#40;&lt;/span&gt;n1, mm&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color:#9966CC; font-weight:bold;"&gt;do&lt;/span&gt; &lt;span style="color:#006600; font-weight:bold;"&gt;|&lt;/span&gt;i&lt;span style="color:#006600; font-weight:bold;"&gt;|&lt;/span&gt;
					j = i &lt;span style="color:#006600; font-weight:bold;"&gt;+&lt;/span&gt; m
					src&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#91;&lt;/span&gt;j&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#93;&lt;/span&gt; = src&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#91;&lt;/span&gt;i&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#93;&lt;/span&gt; &lt;span style="color:#006600; font-weight:bold;"&gt;-&lt;/span&gt; &lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#40;&lt;/span&gt;temp = w &lt;span style="color:#006600; font-weight:bold;"&gt;*&lt;/span&gt; src&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#91;&lt;/span&gt;j&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#41;&lt;/span&gt;
					src&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#91;&lt;/span&gt;i&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#93;&lt;/span&gt; &lt;span style="color:#006600; font-weight:bold;"&gt;+&lt;/span&gt;= temp
				&lt;span style="color:#9966CC; font-weight:bold;"&gt;end&lt;/span&gt;
			&lt;span style="color:#9966CC; font-weight:bold;"&gt;end&lt;/span&gt;
			n2 &lt;span style="color:#006600; font-weight:bold;"&gt;/&lt;/span&gt;= &lt;span style="color:#006666;"&gt;2&lt;/span&gt;
		&lt;span style="color:#9966CC; font-weight:bold;"&gt;end&lt;/span&gt; &lt;span style="color:#9966CC; font-weight:bold;"&gt;while&lt;/span&gt; mm != n
		src
	&lt;span style="color:#9966CC; font-weight:bold;"&gt;end&lt;/span&gt;
&lt;span style="color:#9966CC; font-weight:bold;"&gt;end&lt;/span&gt;
&amp;nbsp;
&lt;span style="color:#9966CC; font-weight:bold;"&gt;class&lt;/span&gt; &lt;span style="color:#CC0066; font-weight:bold;"&gt;String&lt;/span&gt;
	&lt;span style="color:#008000; font-style:italic;"&gt;# parse Complex.new.to_s&lt;/span&gt;
	&lt;span style="color:#9966CC; font-weight:bold;"&gt;def&lt;/span&gt; to_c
		m = @@PATTERN.&lt;span style="color:#9900CC;"&gt;match&lt;/span&gt; &lt;span style="color:#0000FF; font-weight:bold;"&gt;self&lt;/span&gt;
		&lt;span style="color:#0000FF; font-weight:bold;"&gt;return&lt;/span&gt; &lt;span style="color:#0000FF; font-weight:bold;"&gt;nil&lt;/span&gt; &lt;span style="color:#9966CC; font-weight:bold;"&gt;if&lt;/span&gt; m.&lt;span style="color:#0000FF; font-weight:bold;"&gt;nil&lt;/span&gt;?
		&lt;span style="color:#CC00FF; font-weight:bold;"&gt;Complex&lt;/span&gt;.&lt;span style="color:#9900CC;"&gt;new&lt;/span&gt; m&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color:#006666;"&gt;1&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#93;&lt;/span&gt;.&lt;span style="color:#9900CC;"&gt;to_f&lt;/span&gt;, m&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color:#006666;"&gt;2&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#93;&lt;/span&gt;.&lt;span style="color:#9900CC;"&gt;to_f&lt;/span&gt;
	&lt;span style="color:#9966CC; font-weight:bold;"&gt;end&lt;/span&gt;
private
	&lt;span style="color:#008000; font-style:italic;"&gt;# float_pat = /(-?\d+(?:\.\d+)?(?:e[+-]?\d+)?)/&lt;/span&gt;
	@@PATTERN = &lt;span style="color:#006600; font-weight:bold;"&gt;/&lt;/span&gt;^&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#91;&lt;/span&gt; \t\r\n&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;*&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;-&lt;/span&gt;?\d&lt;span style="color:#006600; font-weight:bold;"&gt;+&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#40;&lt;/span&gt;?:\.\d&lt;span style="color:#006600; font-weight:bold;"&gt;+&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#41;&lt;/span&gt;?&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#40;&lt;/span&gt;?:e&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;+-&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#93;&lt;/span&gt;?\d&lt;span style="color:#006600; font-weight:bold;"&gt;+&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#41;&lt;/span&gt;?&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#41;&lt;/span&gt;?\s&lt;span style="color:#006600; font-weight:bold;"&gt;*&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#40;&lt;/span&gt;?:\s&lt;span style="color:#006600; font-weight:bold;"&gt;+|&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;+-&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#41;&lt;/span&gt;\d&lt;span style="color:#006600; font-weight:bold;"&gt;+&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#40;&lt;/span&gt;?:\.\d&lt;span style="color:#006600; font-weight:bold;"&gt;+&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#41;&lt;/span&gt;?&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#40;&lt;/span&gt;?:e&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;+-&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#93;&lt;/span&gt;?\d&lt;span style="color:#006600; font-weight:bold;"&gt;+&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#41;&lt;/span&gt;?i&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#41;&lt;/span&gt;?&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#91;&lt;/span&gt; \t\r\n&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;*&lt;/span&gt;$&lt;span style="color:#006600; font-weight:bold;"&gt;/&lt;/span&gt;
&lt;span style="color:#9966CC; font-weight:bold;"&gt;end&lt;/span&gt;
&amp;nbsp;
values = &lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#93;&lt;/span&gt;
&lt;span style="color:#ff6633; font-weight:bold;"&gt;$stdin&lt;/span&gt;.&lt;span style="color:#9900CC;"&gt;each_line&lt;/span&gt; &lt;span style="color:#9966CC; font-weight:bold;"&gt;do&lt;/span&gt; &lt;span style="color:#006600; font-weight:bold;"&gt;|&lt;/span&gt;l&lt;span style="color:#006600; font-weight:bold;"&gt;|&lt;/span&gt;
	c = l.&lt;span style="color:#9900CC;"&gt;to_c&lt;/span&gt;
	&lt;span style="color:#9966CC; font-weight:bold;"&gt;if&lt;/span&gt; c.&lt;span style="color:#0000FF; font-weight:bold;"&gt;nil&lt;/span&gt;?
		&lt;span style="color:#ff6633; font-weight:bold;"&gt;$stderr&lt;/span&gt;.&lt;span style="color:#CC0066; font-weight:bold;"&gt;puts&lt;/span&gt; &lt;span style="color:#996600;"&gt;&amp;quot;unmatched '#{l}'&amp;quot;&lt;/span&gt;
	&lt;span style="color:#9966CC; font-weight:bold;"&gt;else&lt;/span&gt;
		values &lt;span style="color:#006600; font-weight:bold;"&gt;&amp;lt;&lt;/span&gt; &lt;span style="color:#006600; font-weight:bold;"&gt;&amp;lt;&lt;/span&gt; c
	&lt;span style="color:#9966CC; font-weight:bold;"&gt;end&lt;/span&gt;
&lt;span style="color:#9966CC; font-weight:bold;"&gt;end&lt;/span&gt;
INVERSE = ARGV&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color:#006666;"&gt;0&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#93;&lt;/span&gt; == &lt;span style="color:#996600;"&gt;'inverse'&lt;/span&gt;
&lt;span style="color:#ff6633; font-weight:bold;"&gt;$stderr&lt;/span&gt;.&lt;span style="color:#CC0066; font-weight:bold;"&gt;puts&lt;/span&gt; INVERSE ? &lt;span style="color:#996600;"&gt;'inverse'&lt;/span&gt; : &lt;span style="color:#996600;"&gt;'forward'&lt;/span&gt;
&amp;nbsp;
values.&lt;span style="color:#9900CC;"&gt;fft&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#40;&lt;/span&gt;INVERSE&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#41;&lt;/span&gt;.&lt;span style="color:#9900CC;"&gt;each&lt;/span&gt; &lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#123;&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;|&lt;/span&gt;i&lt;span style="color:#006600; font-weight:bold;"&gt;|&lt;/span&gt; &lt;span style="color:#CC0066; font-weight:bold;"&gt;puts&lt;/span&gt; &lt;span style="color:#996600;"&gt;&amp;quot;#{i.real} #{i.image}i&amp;quot;&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#125;&lt;/span&gt;
&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;WordPress messes up the angle brackets as usual, but there&amp;#8217;s &lt;a href="https://gist.github.com/902724"&gt;a gist for that&lt;/a&gt;.&lt;/p&gt;
&lt;p class="wp-flattr-button"&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://blog.mro.name/?flattrss_redirect&amp;amp;id=2187&amp;amp;md5=1a72004550ffe92a21c30f9955370fdb" title="Flattr" target="_blank"&gt;&lt;img src="http://blog.mro.name/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MRO-Blog/~4/iu3bvbpyJBQ" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://blog.mro.name/2011/04/simple-ruby-fast-fourier-transform/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://blog.mro.name/2011/04/simple-ruby-fast-fourier-transform/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://blog.mro.name/2011/04/simple-ruby-fast-fourier-transform/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Marcus Rohrmoser</name>
						<uri>http://blog.mro.name</uri>
					</author>
		<title type="html"><![CDATA[Randnotiz: Die bayerische Frühgotik und der Islam]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MRO-Blog/~3/_RHl2T4EyH0/" />
		<id>http://blog.mro.name/?p=2138</id>
		<updated>2011-03-22T23:10:46Z</updated>
		<published>2011-03-22T10:25:31Z</published>
		<category scheme="http://blog.mro.name" term="Artikel auf deutsch" /><category scheme="http://blog.mro.name" term="offtopic" /><category scheme="http://blog.mro.name" term="Bayern" /><category scheme="http://blog.mro.name" term="Bayernkurier" /><category scheme="http://blog.mro.name" term="Burghausen" /><category scheme="http://blog.mro.name" term="CSU" /><category scheme="http://blog.mro.name" term="Elisabethkapelle" /><category scheme="http://blog.mro.name" term="Frühgotik" /><category scheme="http://blog.mro.name" term="Geschichte" /><category scheme="http://blog.mro.name" term="Heinrich XIII" /><category scheme="http://blog.mro.name" term="Islam" /><category scheme="http://blog.mro.name" term="Kunstgeschichte" /><category scheme="http://blog.mro.name" term="Laptop" /><category scheme="http://blog.mro.name" term="Lederhose" /><category scheme="http://blog.mro.name" term="Rant" />		<summary type="html"><![CDATA[Neulich war ich auf der Burg zu Burghausen1 und entdeckte auf einem der ältesten Bilder (eine Schutzmantelmadonna) im Palas eine merkwürdige Aufschrift:



Das Bild kam unter einem Stifterbild der Hedwigskapelle1 zum Vorschein und ist eine Rekonstruktion. Offiziell datiert ist das Bild auf
1507
Mir fiel jedoch die verblüffende Ähnlichkeit mit der Zahl 1258 in arabischer Schreibweise2
١٢٥٨
auf, was mir und meiner kunstgeschichtlichen ...]]></summary>
		<content type="html" xml:base="http://blog.mro.name/2011/03/randnotiz-die-bayerische-fruehgotik-und-der-islam/">&lt;p&gt;Neulich war ich auf der &lt;a href="http://de.wikipedia.org/w/index.php?title=Burg_zu_Burghausen&amp;amp;oldid=83748961"&gt;Burg zu Burghausen&lt;/a&gt;&lt;sup&gt;1&lt;/sup&gt; und entdeckte auf einem der ältesten Bilder (eine Schutzmantelmadonna) im Palas eine merkwürdige Aufschrift:&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;a href="http://blog.mro.name/wp-content/uploads/2011/03/Aufschrift-auf-Schutzmantelmadonna-im-Palas-der-Burg-zu-Burghausen.jpg"&gt;&lt;img class="aligncenter" title="Aufschrift auf Schutzmantelmadonna im Palas der Burg zu Burghausen" src="http://blog.mro.name/wp-content/uploads/2011/03/Aufschrift-auf-Schutzmantelmadonna-im-Palas-der-Burg-zu-Burghausen.jpg" alt="" width="440" height="151" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span id="more-2138"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Das Bild kam unter einem Stifterbild der &lt;a href="http://de.wikipedia.org/w/index.php?title=Burg_zu_Burghausen&amp;amp;oldid=83748961#F.C3.BCnfter_Burghof"&gt;Hedwigskapelle&lt;/a&gt;&lt;sup&gt;1&lt;/sup&gt; zum Vorschein und ist eine Rekonstruktion. Offiziell datiert ist das Bild auf&lt;/p&gt;
&lt;p style="text-align: center; font-size: 72pt; margin: 1ex 0;"&gt;1507&lt;/p&gt;
&lt;p&gt;Mir fiel jedoch die verblüffende Ähnlichkeit mit der &lt;a href="http://de.wikipedia.org/w/index.php?title=Indische_Zahlendarstellung&amp;amp;oldid=86473530"&gt;Zahl 1258 in arabischer Schreibweise&lt;/a&gt;&lt;sup&gt;2&lt;/sup&gt;&lt;/p&gt;
&lt;p style="text-align: center; font-size: 72pt; margin: 1ex 0;"&gt;١٢٥٨&lt;/p&gt;
&lt;p&gt;auf, was mir und meiner kunstgeschichtlichen Expertenbegleiterin keine Ruhe ließ. Ergibt eine solche Jahreszahl einen Sinn? Könnte ein Künstler in Burghausen die in Arabien gebräuchlichen Ziffern gekannt haben? Und wieso benutzte er nicht die in Europa (heute) übliche Schreibweise?&lt;/p&gt;
&lt;p&gt;Eine zackige Wikipedia Recherche ergab:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;1202 vollendete &lt;a href="http://de.wikipedia.org/w/index.php?title=Leonardo_Fibonacci&amp;amp;oldid=85499344"&gt;Leonardo Fibonacci&lt;/a&gt;&lt;sup&gt;3&lt;/sup&gt; sein &lt;a href="http://de.wikipedia.org/w/index.php?title=Leonardo_Fibonacci&amp;amp;oldid=85499344#Der_Inhalt_des_Liber_abbaci"&gt;Liber Abbaci&lt;/a&gt;&lt;sup&gt;3&lt;/sup&gt;, in dem er laut Wikipedia &amp;#8220;&lt;a href="http://de.wikipedia.org/w/index.php?title=Indische_Zahlendarstellung&amp;amp;oldid=86473530#Liber_abaci"&gt;unter anderem die indischen Ziffern vorstellt und diese in der Tat als »indische Ziffern« und nicht als »arabische Ziffern« bezeichnet.&lt;/a&gt;&amp;#8220;&lt;sup&gt;2&lt;/sup&gt;,&lt;/li&gt;
&lt;li&gt;1235 empfängt Otto II., Vater und Vorgänger von &lt;a href="http://de.wikipedia.org/w/index.php?title=Heinrich_XIII._(Bayern)&amp;amp;oldid=85290895"&gt;Herzog Heinrich XIII.&lt;/a&gt;&lt;sup&gt;4&lt;/sup&gt;, &amp;#8220;&lt;a href="http://de.wikipedia.org/w/index.php?title=Geschichte_der_Stadt_Burghausen&amp;amp;oldid=86028680#Hochmittelalter"&gt;den aus Italien heimkehrenden Friedrich II. in Burghausen.&lt;/a&gt;&amp;#8220;&lt;sup&gt;5&lt;/sup&gt; — &lt;a href="http://de.wikipedia.org/w/index.php?title=Friedrich_II._(HRR)&amp;amp;oldid=86720244"&gt;Friedrich II.&lt;/a&gt;&lt;sup&gt;6&lt;/sup&gt; war immerhin Kaiser des &lt;a href="http://de.wikipedia.org/wiki/Heiliges_R%C3%B6misches_Reich"&gt;Heiligen Römischen Reiches&lt;/a&gt; und hatte selbst evtl. arabische Grundkenntnisse&lt;sup&gt;7&lt;/sup&gt; ,&lt;/li&gt;
&lt;li&gt;1255 entsteht die &lt;a href="http://de.wikipedia.org/w/index.php?title=Burg_zu_Burghausen&amp;amp;oldid=83748961#Hochmittelalter"&gt;Elisabethkapelle im Palas der Burg zu Burghausen: &amp;#8220;Die innere Schlosskapelle aus diesem Jahr gilt als die älteste frühgotische Kirche im südbayerischen Raum.&amp;#8221;&lt;/a&gt;&lt;sup&gt;1&lt;/sup&gt; &amp;#8211; gebaut von Herzog Heinrich XIII.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Fazit&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Spannend wäre eine Verbindung zwischen Burghausen und Fibonacci abzuklopfen,
&lt;ul&gt;
&lt;li&gt;rege Verbindungen nach Italien bestanden allemal und lassen sich sicher durch kunsthistorische Analysen oder Wirtschaftsbücher überprüfen,&lt;/li&gt;
&lt;li&gt;eine Eingrenzung des Künstlermilieus und Untersuchung ob&amp;#8217;s Verbindungen zu Algebra oder Geometrie aus dem Liber Abbaci gibt,&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;zumindest &lt;strong&gt;zur bayerischen Frühgotik gehört islamische Gelehrsamkeit&lt;/strong&gt; allemal, das sagt der Laptop,&lt;/li&gt;
&lt;/ul&gt;
&lt;p style="text-align: center; font-size: 24pt; margin: 5ex 0;"&gt;aber &lt;a href="http://www.bayernkurier.de/?id=224&amp;amp;showUid=1288"&gt;so posaunt&amp;#8217;s aus der Lederhose&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Quellen&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Seite „Burg zu Burghausen“. In: Wikipedia, Die freie Enzyklopädie.&lt;br /&gt;
Bearbeitungsstand: 11. Januar 2011, 12:48 UTC.&lt;br /&gt;
URL: &lt;a href="http://de.wikipedia.org/w/index.php?title=Burg_zu_Burghausen&amp;amp;oldid=83748961"&gt;http://de.wikipedia.org/w/index.php?title=Burg_zu_Burghausen&amp;amp;oldid=83748961&lt;/a&gt;&lt;br /&gt;
(Abgerufen: 21. März 2011, 16:00 UTC)&lt;/li&gt;
&lt;li&gt;Seite „Indische Zahlendarstellung“. In: Wikipedia, Die freie Enzyklopädie.&lt;br /&gt;
Bearbeitungsstand: 15. März 2011, 10:46 UTC.&lt;br /&gt;
URL: &lt;a href="http://de.wikipedia.org/w/index.php?title=Indische_Zahlendarstellung&amp;amp;oldid=86473530"&gt;http://de.wikipedia.org/w/index.php?title=Indische_Zahlendarstellung&amp;amp;oldid=86473530&lt;/a&gt;&lt;br /&gt;
(Abgerufen: 21. März 2011, 16:03 UTC)&lt;/li&gt;
&lt;li&gt;Seite „Leonardo Fibonacci“. In: Wikipedia, Die freie Enzyklopädie.&lt;br /&gt;
Bearbeitungsstand: 19. Februar 2011, 17:59 UTC.&lt;br /&gt;
URL: &lt;a href="http://de.wikipedia.org/w/index.php?title=Leonardo_Fibonacci&amp;amp;oldid=85499344"&gt;http://de.wikipedia.org/w/index.php?title=Leonardo_Fibonacci&amp;amp;oldid=85499344&lt;/a&gt;&lt;br /&gt;
(Abgerufen: 21. März 2011, 16:05 UTC)&lt;/li&gt;
&lt;li&gt;Seite „Heinrich XIII. (Bayern)“. In: Wikipedia, Die freie Enzyklopädie.&lt;br /&gt;
Bearbeitungsstand: 14. Februar 2011, 17:08 UTC.&lt;br /&gt;
URL: &lt;a href="http://de.wikipedia.org/w/index.php?title=Heinrich_XIII._(Bayern)&amp;amp;oldid=85290895"&gt;http://de.wikipedia.org/w/index.php?title=Heinrich_XIII._(Bayern)&amp;amp;oldid=85290895&lt;/a&gt;&lt;br /&gt;
(Abgerufen: 21. März 2011, 16:08 UTC)&lt;/li&gt;
&lt;li&gt;Seite „Geschichte der Stadt Burghausen“. In: Wikipedia, Die freie Enzyklopädie.&lt;br /&gt;
Bearbeitungsstand: 4. März 2011, 10:16 UTC.&lt;br /&gt;
URL: &lt;a href="http://de.wikipedia.org/w/index.php?title=Geschichte_der_Stadt_Burghausen&amp;amp;oldid=86028680"&gt;http://de.wikipedia.org/w/index.php?title=Geschichte_der_Stadt_Burghausen&amp;amp;oldid=86028680&lt;/a&gt;&lt;br /&gt;
(Abgerufen: 22. März 2011, 09:02 UTC)&lt;/li&gt;
&lt;li&gt;Seite „Friedrich II. (HRR)“. In: Wikipedia, Die freie Enzyklopädie.&lt;br /&gt;
Bearbeitungsstand: 21. März 2011, 06:52 UTC.&lt;br /&gt;
URL: &lt;a href="http://de.wikipedia.org/w/index.php?title=Friedrich_II._(HRR)&amp;amp;oldid=86720244"&gt;http://de.wikipedia.org/w/index.php?title=Friedrich_II._(HRR)&amp;amp;oldid=86720244&lt;/a&gt;&lt;br /&gt;
(Abgerufen: 22. März 2011, 09:07 UTC)&lt;/li&gt;
&lt;li&gt;Siehe &lt;a href="http://de.wikipedia.org/w/index.php?title=Friedrich_II._(HRR)&amp;amp;oldid=86720244#cite_note-0"&gt;hier&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;P.S.: Sämtliche Zitate und Quellen sind zwar nur aus Wikipedia, aber als solche ausgewiesen und verlinkt &amp;#8211; das hier ist schließlich ein seriöser Blog und keine juristische Dissertation.&lt;/p&gt;
&lt;p class="wp-flattr-button"&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://blog.mro.name/?flattrss_redirect&amp;amp;id=2138&amp;amp;md5=81f9339aa00c78c65423122ec7590961" title="Flattr" target="_blank"&gt;&lt;img src="http://blog.mro.name/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MRO-Blog/~4/_RHl2T4EyH0" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://blog.mro.name/2011/03/randnotiz-die-bayerische-fruehgotik-und-der-islam/#comments" thr:count="1" />
		<link rel="replies" type="application/atom+xml" href="http://blog.mro.name/2011/03/randnotiz-die-bayerische-fruehgotik-und-der-islam/feed/atom/" thr:count="1" />
		<thr:total>1</thr:total>
	<feedburner:origLink>http://blog.mro.name/2011/03/randnotiz-die-bayerische-fruehgotik-und-der-islam/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Marcus Rohrmoser</name>
						<uri>http://blog.mro.name</uri>
					</author>
		<title type="html"><![CDATA[Vortrag: Index Suche mit CoreData und SQLite]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MRO-Blog/~3/MNkSNgvmjAI/" />
		<id>http://blog.mro.name/?p=2134</id>
		<updated>2011-01-27T09:39:35Z</updated>
		<published>2011-01-27T09:39:35Z</published>
		<category scheme="http://blog.mro.name" term="Artikel auf deutsch" /><category scheme="http://blog.mro.name" term="development" /><category scheme="http://blog.mro.name" term="Cocoa" /><category scheme="http://blog.mro.name" term="CocoaHeads" /><category scheme="http://blog.mro.name" term="CoreData" /><category scheme="http://blog.mro.name" term="Fulltext" /><category scheme="http://blog.mro.name" term="iPhone" /><category scheme="http://blog.mro.name" term="Search" /><category scheme="http://blog.mro.name" term="SQLite" /><category scheme="http://blog.mro.name" term="Vortrag" />		<summary type="html"><![CDATA[Gestern gab's einen Mini-Vortrag von mir bei den CocoaHeads München:

	CoreData (iOS) ist nur mit Tricks dazu zu bringen den Index bei Textsuche zu benutzen,
	SQLite Full Text Search (FTS) ist der Hammer.

Die Folien dazu.]]></summary>
		<content type="html" xml:base="http://blog.mro.name/2011/01/vortrag-index-suche-mit-coredata-und-sqlite/">&lt;p&gt;Gestern gab&amp;#8217;s einen Mini-Vortrag von mir bei den &lt;a href="http://cocoaheads.org/de/Munich/"&gt;CocoaHeads München&lt;/a&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://wiki.mro.name/cocoaheads/binary_search#coredata"&gt;CoreData (iOS) ist nur mit Tricks dazu zu bringen den Index bei Textsuche zu benutzen&lt;/a&gt;,&lt;/li&gt;
&lt;li&gt;&lt;a href="http://wiki.mro.name/cocoaheads/binary_search#sqlite_fulltext_index"&gt;SQLite Full Text Search (FTS) ist der Hammer&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://wiki.mro.name/_export/s5/cocoaheads/binary_search"&gt;Die Folien dazu&lt;/a&gt;.&lt;/p&gt;
&lt;p class="wp-flattr-button"&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://blog.mro.name/?flattrss_redirect&amp;amp;id=2134&amp;amp;md5=d639d06c7073f502547f628a68d2ec40" title="Flattr" target="_blank"&gt;&lt;img src="http://blog.mro.name/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MRO-Blog/~4/MNkSNgvmjAI" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://blog.mro.name/2011/01/vortrag-index-suche-mit-coredata-und-sqlite/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://blog.mro.name/2011/01/vortrag-index-suche-mit-coredata-und-sqlite/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://blog.mro.name/2011/01/vortrag-index-suche-mit-coredata-und-sqlite/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Marcus Rohrmoser</name>
						<uri>http://blog.mro.name</uri>
					</author>
		<title type="html"><![CDATA[AlcoCalc iPhone App online!]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MRO-Blog/~3/E47OBUtx-x8/" />
		<id>http://blog.mro.name/?p=2108</id>
		<updated>2011-01-13T14:04:31Z</updated>
		<published>2011-01-13T14:03:21Z</published>
		<category scheme="http://blog.mro.name" term="Artikel auf deutsch" /><category scheme="http://blog.mro.name" term="development" /><category scheme="http://blog.mro.name" term="AlcoCalc" /><category scheme="http://blog.mro.name" term="App Store" /><category scheme="http://blog.mro.name" term="Blutalkoholkonzentration" /><category scheme="http://blog.mro.name" term="iPhone" /><category scheme="http://blog.mro.name" term="Projects" /><category scheme="http://blog.mro.name" term="Promille" /><category scheme="http://blog.mro.name" term="Promillerechner" /><category scheme="http://blog.mro.name" term="Widmark Formel" />		<summary type="html"><![CDATA[Hurra! Vor einigen Tagen ist die erste Version des Promillerechners im  erschienen. Die App merkt sich was Du wann getrunken hast und schätzt nach der Widmark Formel grob den aktuellen und fallenden Promillewert ab:







.]]></summary>
		<content type="html" xml:base="http://blog.mro.name/2011/01/alcocalc-iphone-app-online/">&lt;p&gt;Hurra! Vor einigen Tagen ist die erste Version des Promillerechners im &lt;a href="http://itunes.apple.com/de/app/alcocalc/id383301852"&gt;&lt;img class="size-full wp-image-2113 alignnone" style="vertical-align: middle;" title="AlcoCalc App Store Link" src="http://blog.mro.name/wp-content/uploads/2011/01/appstore.png" alt="AlcoCalc App Store Link" width="116" height="40" /&gt;&lt;/a&gt; erschienen. Die App merkt sich was Du wann getrunken hast und schätzt nach der &lt;a href="http://de.wikipedia.org/wiki/Blutalkoholkonzentration#Widmark-Formel"&gt;Widmark Formel&lt;/a&gt; grob den aktuellen und fallenden Promillewert ab:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blog.mro.name/wp-content/uploads/2011/01/alcocalc.curve_.png"&gt;&lt;img class="aligncenter size-medium wp-image-2110" title="Promillekurve" src="http://blog.mro.name/wp-content/uploads/2011/01/alcocalc.curve_-300x200.png" alt="" width="300" height="200" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blog.mro.name/wp-content/uploads/2011/01/alcocalc.curve_.png"&gt;&lt;/a&gt;&lt;a href="http://blog.mro.name/wp-content/uploads/2011/01/alcocalc.drinks.png"&gt;&lt;img class="size-medium wp-image-2111 aligncenter" title="Getrunkenes" src="http://blog.mro.name/wp-content/uploads/2011/01/alcocalc.drinks-200x300.png" alt="" width="200" height="300" /&gt;&lt;/a&gt;&lt;a href="http://blog.mro.name/wp-content/uploads/2011/01/alcocalc.edit_.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blog.mro.name/wp-content/uploads/2011/01/alcocalc.edit_.png"&gt;&lt;img class="size-medium wp-image-2112 aligncenter" title="Getränk anlegen" src="http://blog.mro.name/wp-content/uploads/2011/01/alcocalc.edit_-200x300.png" alt="" width="200" height="300" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;.&lt;/p&gt;
&lt;p class="wp-flattr-button"&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://blog.mro.name/?flattrss_redirect&amp;amp;id=2108&amp;amp;md5=71f0681b8bfa5cd5ba22d393c012da88" title="Flattr" target="_blank"&gt;&lt;img src="http://blog.mro.name/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MRO-Blog/~4/E47OBUtx-x8" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://blog.mro.name/2011/01/alcocalc-iphone-app-online/#comments" thr:count="3" />
		<link rel="replies" type="application/atom+xml" href="http://blog.mro.name/2011/01/alcocalc-iphone-app-online/feed/atom/" thr:count="3" />
		<thr:total>3</thr:total>
	<feedburner:origLink>http://blog.mro.name/2011/01/alcocalc-iphone-app-online/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Marcus Rohrmoser</name>
						<uri>http://blog.mro.name</uri>
					</author>
		<title type="html"><![CDATA[High-Res UIImage remote load]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MRO-Blog/~3/AkIY93vapbg/" />
		<id>http://blog.mro.name/?p=2076</id>
		<updated>2010-11-08T10:24:22Z</updated>
		<published>2010-11-08T10:10:12Z</published>
		<category scheme="http://blog.mro.name" term="Articles in english" /><category scheme="http://blog.mro.name" term="development" /><category scheme="http://blog.mro.name" term="Cocoa" /><category scheme="http://blog.mro.name" term="iPhone" /><category scheme="http://blog.mro.name" term="iPhone4" /><category scheme="http://blog.mro.name" term="Retina Display" /><category scheme="http://blog.mro.name" term="UIImage" />		<summary type="html"><![CDATA[Loading UIImages automatically in high-resolution works fine for locally stored images - but if you want to fetch them via remote URL you have to code yourself.

A simple, blocking but backward compatible (iOS &#62;= 3.0, maybe even 2.0 but untested)  implementation could look like this:
@implementation UIImage (MRORemote)
 
// add the @2x filename suffix
+(NSURL *)url2x:(NSURL ...]]></summary>
		<content type="html" xml:base="http://blog.mro.name/2010/11/high-res-uiimage-remote-load/">&lt;p&gt;Loading &lt;a href="http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iphoneosprogrammingguide/SupportingResolutionIndependence/SupportingResolutionIndependence.html%23//apple_ref/doc/uid/TP40007072-CH10-SW3"&gt;&lt;tt&gt;UIImage&lt;/tt&gt;s automatically in high-resolution &lt;/a&gt;works fine for locally stored images &amp;#8211; but if you want to fetch them via remote URL you have to code yourself.&lt;/p&gt;
&lt;p&gt;A simple, blocking but backward compatible (iOS &amp;gt;= 3.0, maybe even 2.0 but untested)  implementation could look like this:&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="objc" style="font-family:monospace;"&gt;&lt;span style="color: #a61390;"&gt;@implementation&lt;/span&gt; UIImage &lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;MRORemote&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #11740a; font-style: italic;"&gt;// add the @2x filename suffix&lt;/span&gt;
&lt;span style="color: #002200;"&gt;+&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #400080;"&gt;NSURL&lt;/span&gt; &lt;span style="color: #002200;"&gt;*&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;url2x&lt;span style="color: #002200;"&gt;:&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #400080;"&gt;NSURL&lt;/span&gt; &lt;span style="color: #002200;"&gt;*&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;url
&lt;span style="color: #002200;"&gt;&amp;#123;&lt;/span&gt;
  &lt;span style="color: #400080;"&gt;NSString&lt;/span&gt; &lt;span style="color: #002200;"&gt;*&lt;/span&gt;path &lt;span style="color: #002200;"&gt;=&lt;/span&gt; url.path;
  NSAssert&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;path &lt;span style="color: #002200;"&gt;!=&lt;/span&gt; &lt;span style="color: #a61390;"&gt;nil&lt;/span&gt;, &lt;span style="color: #bf1d1a;"&gt;@&lt;/span&gt;&lt;span style="color: #bf1d1a;"&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;;
  &lt;span style="color: #400080;"&gt;NSString&lt;/span&gt; &lt;span style="color: #002200;"&gt;*&lt;/span&gt;last &lt;span style="color: #002200;"&gt;=&lt;/span&gt; path.lastPathComponent;
  &lt;span style="color: #400080;"&gt;NSString&lt;/span&gt; &lt;span style="color: #002200;"&gt;*&lt;/span&gt;ext &lt;span style="color: #002200;"&gt;=&lt;/span&gt; path.pathExtension;
  NSAssert&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;last &lt;span style="color: #002200;"&gt;!=&lt;/span&gt; &lt;span style="color: #a61390;"&gt;nil&lt;/span&gt;, &lt;span style="color: #bf1d1a;"&gt;@&lt;/span&gt;&lt;span style="color: #bf1d1a;"&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;;
  NSAssert&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;ext &lt;span style="color: #002200;"&gt;!=&lt;/span&gt; &lt;span style="color: #a61390;"&gt;nil&lt;/span&gt;, &lt;span style="color: #bf1d1a;"&gt;@&lt;/span&gt;&lt;span style="color: #bf1d1a;"&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;;
  &lt;span style="color: #400080;"&gt;NSString&lt;/span&gt; &lt;span style="color: #002200;"&gt;*&lt;/span&gt;part &lt;span style="color: #002200;"&gt;=&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#91;&lt;/span&gt;last substringToIndex&lt;span style="color: #002200;"&gt;:&lt;/span&gt;MAX&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #2400d9;"&gt;0&lt;/span&gt;, last.length &lt;span style="color: #002200;"&gt;-&lt;/span&gt; ext.length &lt;span style="color: #002200;"&gt;-&lt;/span&gt; &lt;span style="color: #2400d9;"&gt;1&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#93;&lt;/span&gt;;
  &lt;span style="color: #a61390;"&gt;return&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #400080;"&gt;NSURL&lt;/span&gt; URLWithString&lt;span style="color: #002200;"&gt;:&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #400080;"&gt;NSString&lt;/span&gt; stringWithFormat&lt;span style="color: #002200;"&gt;:&lt;/span&gt;&lt;span style="color: #bf1d1a;"&gt;@&lt;/span&gt;&lt;span style="color: #bf1d1a;"&gt;&amp;quot;%@@2x.%@&amp;quot;&lt;/span&gt;, part, ext&lt;span style="color: #002200;"&gt;&amp;#93;&lt;/span&gt; relativeToURL&lt;span style="color: #002200;"&gt;:&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#91;&lt;/span&gt;url absoluteURL&lt;span style="color: #002200;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#93;&lt;/span&gt;;
&lt;span style="color: #002200;"&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #002200;"&gt;+&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;UIImage &lt;span style="color: #002200;"&gt;*&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;imageWithContentsOfURL&lt;span style="color: #002200;"&gt;:&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #400080;"&gt;NSURL&lt;/span&gt; &lt;span style="color: #002200;"&gt;*&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;url probe2x&lt;span style="color: #002200;"&gt;:&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #a61390;"&gt;BOOL&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;probe2x
&lt;span style="color: #002200;"&gt;&amp;#123;&lt;/span&gt;
  &lt;span style="color: #a61390;"&gt;if&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt; url &lt;span style="color: #002200;"&gt;==&lt;/span&gt; &lt;span style="color: #a61390;"&gt;nil&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;
    &lt;span style="color: #a61390;"&gt;return&lt;/span&gt; &lt;span style="color: #a61390;"&gt;nil&lt;/span&gt;;
  UIScreen &lt;span style="color: #002200;"&gt;*&lt;/span&gt;screen &lt;span style="color: #002200;"&gt;=&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#91;&lt;/span&gt;UIScreen mainScreen&lt;span style="color: #002200;"&gt;&amp;#93;&lt;/span&gt;;
  &lt;span style="color: #a61390;"&gt;const&lt;/span&gt; CGFloat scale &lt;span style="color: #002200;"&gt;=&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#91;&lt;/span&gt;screen respondsToSelector&lt;span style="color: #002200;"&gt;:&lt;/span&gt;&lt;span style="color: #a61390;"&gt;@selector&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;scale&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#93;&lt;/span&gt; ? &lt;span style="color: #002200;"&gt;&amp;#91;&lt;/span&gt;screen scale&lt;span style="color: #002200;"&gt;&amp;#93;&lt;/span&gt; &lt;span style="color: #002200;"&gt;:&lt;/span&gt; 1.0f;
  &lt;span style="color: #a61390;"&gt;if&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt; probe2x &lt;span style="color: #002200;"&gt;&amp;amp;&amp;amp;&lt;/span&gt; 2.0f &lt;span style="color: #002200;"&gt;==&lt;/span&gt; scale &lt;span style="color: #002200;"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#91;&lt;/span&gt;UIImage respondsToSelector&lt;span style="color: #002200;"&gt;:&lt;/span&gt;&lt;span style="color: #a61390;"&gt;@selector&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;imageWithCGImage&lt;span style="color: #002200;"&gt;:&lt;/span&gt;scale&lt;span style="color: #002200;"&gt;:&lt;/span&gt;orientation&lt;span style="color: #002200;"&gt;:&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#93;&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#123;&lt;/span&gt;
    UIImage &lt;span style="color: #002200;"&gt;*&lt;/span&gt;img &lt;span style="color: #002200;"&gt;=&lt;/span&gt; &lt;span style="color: #a61390;"&gt;nil&lt;/span&gt;;
    &lt;span style="color: #400080;"&gt;NSData&lt;/span&gt; &lt;span style="color: #002200;"&gt;*&lt;/span&gt;raw &lt;span style="color: #002200;"&gt;=&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #400080;"&gt;NSData&lt;/span&gt; dataWithContentsOfURL&lt;span style="color: #002200;"&gt;:&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#91;&lt;/span&gt;UIImage url2x&lt;span style="color: #002200;"&gt;:&lt;/span&gt;url&lt;span style="color: #002200;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#93;&lt;/span&gt;;
    &lt;span style="color: #a61390;"&gt;if&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt; raw &lt;span style="color: #002200;"&gt;!=&lt;/span&gt; &lt;span style="color: #a61390;"&gt;nil&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;
      img &lt;span style="color: #002200;"&gt;=&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#91;&lt;/span&gt;UIImage imageWithData&lt;span style="color: #002200;"&gt;:&lt;/span&gt;raw&lt;span style="color: #002200;"&gt;&amp;#93;&lt;/span&gt;;
    &lt;span style="color: #a61390;"&gt;if&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt; img &lt;span style="color: #002200;"&gt;!=&lt;/span&gt; &lt;span style="color: #a61390;"&gt;nil&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;
      img &lt;span style="color: #002200;"&gt;=&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#91;&lt;/span&gt;UIImage imageWithCGImage&lt;span style="color: #002200;"&gt;:&lt;/span&gt;img.CGImage scale&lt;span style="color: #002200;"&gt;:&lt;/span&gt;scale orientation&lt;span style="color: #002200;"&gt;:&lt;/span&gt;img.imageOrientation&lt;span style="color: #002200;"&gt;&amp;#93;&lt;/span&gt;;
    &lt;span style="color: #a61390;"&gt;if&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt; img &lt;span style="color: #002200;"&gt;!=&lt;/span&gt; &lt;span style="color: #a61390;"&gt;nil&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;
      &lt;span style="color: #a61390;"&gt;return&lt;/span&gt; img;
    NSAssert&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;raw &lt;span style="color: #002200;"&gt;==&lt;/span&gt; &lt;span style="color: #a61390;"&gt;nil&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;amp;&amp;amp;&lt;/span&gt; img &lt;span style="color: #002200;"&gt;==&lt;/span&gt; &lt;span style="color: #a61390;"&gt;nil&lt;/span&gt;, &lt;span style="color: #bf1d1a;"&gt;@&lt;/span&gt;&lt;span style="color: #bf1d1a;"&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;;
  &lt;span style="color: #002200;"&gt;&amp;#125;&lt;/span&gt;
  &lt;span style="color: #11740a; font-style: italic;"&gt;// MRLogD(@&amp;quot;loading %@&amp;quot;, [url absoluteURL]);&lt;/span&gt;
  &lt;span style="color: #400080;"&gt;NSData&lt;/span&gt; &lt;span style="color: #002200;"&gt;*&lt;/span&gt;raw &lt;span style="color: #002200;"&gt;=&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #400080;"&gt;NSData&lt;/span&gt; dataWithContentsOfURL&lt;span style="color: #002200;"&gt;:&lt;/span&gt;url&lt;span style="color: #002200;"&gt;&amp;#93;&lt;/span&gt;;
  &lt;span style="color: #a61390;"&gt;if&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt; raw &lt;span style="color: #002200;"&gt;==&lt;/span&gt; &lt;span style="color: #a61390;"&gt;nil&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;
    &lt;span style="color: #a61390;"&gt;return&lt;/span&gt; &lt;span style="color: #a61390;"&gt;nil&lt;/span&gt;;
  &lt;span style="color: #a61390;"&gt;return&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#91;&lt;/span&gt;UIImage imageWithData&lt;span style="color: #002200;"&gt;:&lt;/span&gt;raw&lt;span style="color: #002200;"&gt;&amp;#93;&lt;/span&gt;;
&lt;span style="color: #002200;"&gt;&amp;#125;&lt;/span&gt;
&lt;span style="color: #a61390;"&gt;@end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Use at your will but without any warranty.&lt;/p&gt;
&lt;p class="wp-flattr-button"&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MRO-Blog/~4/AkIY93vapbg" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://blog.mro.name/2010/11/high-res-uiimage-remote-load/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://blog.mro.name/2010/11/high-res-uiimage-remote-load/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://blog.mro.name/2010/11/high-res-uiimage-remote-load/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Marcus Rohrmoser</name>
						<uri>http://blog.mro.name</uri>
					</author>
		<title type="html"><![CDATA[High-Res Artwork Management Automation]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MRO-Blog/~3/1DyISXQFenI/" />
		<id>http://blog.mro.name/?p=1986</id>
		<updated>2010-10-24T16:45:48Z</updated>
		<published>2010-10-22T10:17:23Z</published>
		<category scheme="http://blog.mro.name" term="Articles in english" /><category scheme="http://blog.mro.name" term="development" /><category scheme="http://blog.mro.name" term="ImageMagick" /><category scheme="http://blog.mro.name" term="iPhone" /><category scheme="http://blog.mro.name" term="iPhone4" /><category scheme="http://blog.mro.name" term="make" /><category scheme="http://blog.mro.name" term="Makefile" /><category scheme="http://blog.mro.name" term="Retina Display" />		<summary type="html"><![CDATA[The iPhone4 comes with a super high-res display and to leverage that encourages App Developers to provide all artwork twofold - once "normal" and once in double resolution named equally with a "@2x" suffix.

To ease my designers' life and avoid confusion (and designers are easily confused I found) I ask them to provide the ...]]></summary>
		<content type="html" xml:base="http://blog.mro.name/2010/10/high-res-artwork-management-automation/">&lt;p&gt;The iPhone4 comes with a &lt;a href="http://www.apple.com/iphone/features/retina-display.html"&gt;super high-res display&lt;/a&gt; and to leverage that encourages App Developers to provide all artwork twofold &amp;#8211; once &amp;#8220;normal&amp;#8221; and once in double resolution named equally with a &amp;#8220;&lt;code&gt;@2x&lt;/code&gt;&amp;#8221; suffix.&lt;/p&gt;
&lt;p&gt;To ease my designers&amp;#8217; life and avoid confusion (and designers are easily confused I found) I ask them to provide the high-res artwork only and I scale it down myself. And as this is a reoccuring task, I automated via a &lt;a href="http://en.wikipedia.org/wiki/Make_(software)"&gt;Makefile&lt;/a&gt; like this:&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="make" style="font-family:monospace;"&gt;&lt;span style="color: #339900; font-style: italic;"&gt;#!/usr/bin/make&lt;/span&gt;
&lt;span style="color: #339900; font-style: italic;"&gt;# Make help: http://www.gnu.org/software/make/manual/html_node/Phony-Targets.html#Phony-Targets&lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #339900; font-style: italic;"&gt;# Requires ImageMagick, Installation per macport: $ sudo port install imagemagick +no_x11&lt;/span&gt;
CONVERT	&lt;span style="color: #004400;"&gt;:=&lt;/span&gt;	convert
&amp;nbsp;
&lt;span style="color: #339900; font-style: italic;"&gt;# Where are the images?&lt;/span&gt;
ASSETS_DIR &lt;span style="color: #004400;"&gt;:=&lt;/span&gt; &lt;span style="color: #004400;"&gt;.&lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #339900; font-style: italic;"&gt;# Which ones? All @2x.png plus twins without @2x.png&lt;/span&gt;
ASSETS_HIGH	&lt;span style="color: #004400;"&gt;:=&lt;/span&gt;	&lt;span style="color: #004400;"&gt;$&lt;/span&gt;&lt;span style="color: #004400;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #0000CC; font-weight: bold;"&gt;wildcard&lt;/span&gt; &lt;span style="color: #004400;"&gt;$&lt;/span&gt;&lt;span style="color: #004400;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #000088;"&gt;ASSETS_DIR&lt;/span&gt;&lt;span style="color: #004400;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #004400;"&gt;/*@&lt;/span&gt;2x&lt;span style="color: #004400;"&gt;.&lt;/span&gt;png&lt;span style="color: #004400;"&gt;&amp;#41;&lt;/span&gt;
ASSETS_LOW	&lt;span style="color: #004400;"&gt;:=&lt;/span&gt;	&lt;span style="color: #004400;"&gt;$&lt;/span&gt;&lt;span style="color: #004400;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #0000CC; font-weight: bold;"&gt;patsubst&lt;/span&gt; &lt;span style="color: #004400;"&gt;%@&lt;/span&gt;2x&lt;span style="color: #004400;"&gt;.&lt;/span&gt;png&lt;span style="color: #004400;"&gt;,%.&lt;/span&gt;png&lt;span style="color: #004400;"&gt;,$&lt;/span&gt;&lt;span style="color: #004400;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #000088;"&gt;ASSETS_HIGH&lt;/span&gt;&lt;span style="color: #004400;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #004400;"&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #339900; font-style: italic;"&gt;# The scaling command&lt;/span&gt;
&lt;span style="color: #004400;"&gt;%.&lt;/span&gt;png&lt;span style="color: #004400;"&gt;:&lt;/span&gt; &lt;span style="color: #004400;"&gt;%@&lt;/span&gt;2x&lt;span style="color: #004400;"&gt;.&lt;/span&gt;png
	convert &lt;span style="color: #000088; font-weight: bold;"&gt;$&amp;lt;&lt;/span&gt; &lt;span style="color: #004400;"&gt;-&lt;/span&gt;resize &lt;span style="color: #CC2200;"&gt;50&lt;/span&gt;&lt;span style="color: #004400;"&gt;%&lt;/span&gt; &lt;span style="color: #000088; font-weight: bold;"&gt;$@&lt;/span&gt;
&amp;nbsp;
assets&lt;span style="color: #004400;"&gt;:&lt;/span&gt; &lt;span style="color: #004400;"&gt;$&lt;/span&gt;&lt;span style="color: #004400;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #000088;"&gt;ASSETS_LOW&lt;/span&gt;&lt;span style="color: #004400;"&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
clean&lt;span style="color: #004400;"&gt;:&lt;/span&gt;
	&lt;span style="color: #004400;"&gt;-&lt;/span&gt;rm &lt;span style="color: #004400;"&gt;$&lt;/span&gt;&lt;span style="color: #004400;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #000088;"&gt;ASSETS_LOW&lt;/span&gt;&lt;span style="color: #004400;"&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;See also my &lt;a href="http://wiki.mro.name/iphone/faq#iphone_4_-_doppelte_pixeldichte"&gt;link collection about high-res images&lt;/a&gt; and my &lt;a href="http://wiki.mro.name/iphone/xcode_project_setup#makefile"&gt;general Xcode project setup&lt;/a&gt;.&lt;/p&gt;
&lt;p class="wp-flattr-button"&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MRO-Blog/~4/1DyISXQFenI" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://blog.mro.name/2010/10/high-res-artwork-management-automation/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://blog.mro.name/2010/10/high-res-artwork-management-automation/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://blog.mro.name/2010/10/high-res-artwork-management-automation/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Marcus Rohrmoser</name>
						<uri>http://blog.mro.name</uri>
					</author>
		<title type="html"><![CDATA[Upgrade iOS SDK 4.0 -&gt; 4.1 with custom location]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MRO-Blog/~3/ey8WKCSt7qQ/" />
		<id>http://blog.mro.name/?p=1972</id>
		<updated>2010-10-24T18:50:13Z</updated>
		<published>2010-09-24T10:04:17Z</published>
		<category scheme="http://blog.mro.name" term="Articles in english" /><category scheme="http://blog.mro.name" term="development" /><category scheme="http://blog.mro.name" term="cruft" /><category scheme="http://blog.mro.name" term="failure" /><category scheme="http://blog.mro.name" term="iOS" /><category scheme="http://blog.mro.name" term="iPhone" /><category scheme="http://blog.mro.name" term="SDK" /><category scheme="http://blog.mro.name" term="XCode" />		<summary type="html"><![CDATA[again, for my custom install location I need to prepare:

	cleanly uninstall and remove cruft:
$ dir=/Users/Developer.SnowLeopard
$ sudo sh $dir/Library/uninstall-devtools
$ sudo rm -r $dir/*
$ sudo mv /Developer /Developer.deleteme

	then do the custom-location install and
	finally restore some hotfix softlinks:
$ dir=/Users/Developer.SnowLeopard
$ sudo ln -s $dir/Platforms /Developer/Platforms
$ sudo ln -s $dir/SDKs /Developer/SDKs
$ sudo ln -s $dir/Applications/Xcode.app /Developer/Applications/Xcode.app


Not removing the cruft ...]]></summary>
		<content type="html" xml:base="http://blog.mro.name/2010/09/upgrade-ios-4-0-to-4-1-with-custom-location/">&lt;p&gt;again, for my custom install location I need to prepare:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;cleanly uninstall and remove cruft:

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="bash" style="font-family:monospace;"&gt;$ &lt;span style="color: #007800;"&gt;dir&lt;/span&gt;=&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Users&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Developer.SnowLeopard
$ &lt;span style="color: #c20cb9; font-weight: bold;"&gt;sudo&lt;/span&gt; &lt;span style="color: #c20cb9; font-weight: bold;"&gt;sh&lt;/span&gt; &lt;span style="color: #007800;"&gt;$dir&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Library&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;uninstall-devtools
$ &lt;span style="color: #c20cb9; font-weight: bold;"&gt;sudo&lt;/span&gt; &lt;span style="color: #c20cb9; font-weight: bold;"&gt;rm&lt;/span&gt; &lt;span style="color: #660033;"&gt;-r&lt;/span&gt; &lt;span style="color: #007800;"&gt;$dir&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/*&lt;/span&gt;
$ &lt;span style="color: #c20cb9; font-weight: bold;"&gt;sudo&lt;/span&gt; &lt;span style="color: #c20cb9; font-weight: bold;"&gt;mv&lt;/span&gt; &lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Developer &lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Developer.deleteme&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;/li&gt;
&lt;li&gt;then do the custom-location install and&lt;/li&gt;
&lt;li&gt;finally restore some &lt;a href="http://blog.mro.name/2010/06/ios-4-simulator-crash-when-installed-to-custom-folder/"&gt;hotfix softlinks&lt;/a&gt;:

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="bash" style="font-family:monospace;"&gt;$ &lt;span style="color: #007800;"&gt;dir&lt;/span&gt;=&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Users&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Developer.SnowLeopard
$ &lt;span style="color: #c20cb9; font-weight: bold;"&gt;sudo&lt;/span&gt; &lt;span style="color: #c20cb9; font-weight: bold;"&gt;ln&lt;/span&gt; &lt;span style="color: #660033;"&gt;-s&lt;/span&gt; &lt;span style="color: #007800;"&gt;$dir&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Platforms &lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Developer&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Platforms
$ &lt;span style="color: #c20cb9; font-weight: bold;"&gt;sudo&lt;/span&gt; &lt;span style="color: #c20cb9; font-weight: bold;"&gt;ln&lt;/span&gt; &lt;span style="color: #660033;"&gt;-s&lt;/span&gt; &lt;span style="color: #007800;"&gt;$dir&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;SDKs &lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Developer&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;SDKs
$ &lt;span style="color: #c20cb9; font-weight: bold;"&gt;sudo&lt;/span&gt; &lt;span style="color: #c20cb9; font-weight: bold;"&gt;ln&lt;/span&gt; &lt;span style="color: #660033;"&gt;-s&lt;/span&gt; &lt;span style="color: #007800;"&gt;$dir&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Applications&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Xcode.app &lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Developer&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Applications&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Xcode.app&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Not removing the cruft will get you this quite terse error message:&lt;/p&gt;
&lt;div id="attachment_1975" class="wp-caption aligncenter" style="width: 310px"&gt;&lt;a href="http://blog.mro.name/wp-content/uploads/2010/09/xcode-3.2.4-install-failure.png"&gt;&lt;img class="size-medium wp-image-1975" title="XCode 3.2.4 install without prior cleaning " src="http://blog.mro.name/wp-content/uploads/2010/09/xcode-3.2.4-install-failure-300x222.png" alt="XCode 3.2.4 install without prior cleaning " width="300" height="222" /&gt;&lt;/a&gt;&lt;p class="wp-caption-text"&gt;XCode 3.2.4 install without prior cleaning &lt;/p&gt;&lt;/div&gt;
&lt;p class="wp-flattr-button"&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MRO-Blog/~4/ey8WKCSt7qQ" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://blog.mro.name/2010/09/upgrade-ios-4-0-to-4-1-with-custom-location/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://blog.mro.name/2010/09/upgrade-ios-4-0-to-4-1-with-custom-location/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://blog.mro.name/2010/09/upgrade-ios-4-0-to-4-1-with-custom-location/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Marcus Rohrmoser</name>
						<uri>http://blog.mro.name</uri>
					</author>
		<title type="html"><![CDATA[Vortrag: Parser mit Ragel]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MRO-Blog/~3/1v_7VyrNQSQ/" />
		<id>http://blog.mro.name/?p=1961</id>
		<updated>2010-09-22T22:02:46Z</updated>
		<published>2010-09-22T21:51:29Z</published>
		<category scheme="http://blog.mro.name" term="Artikel auf deutsch" /><category scheme="http://blog.mro.name" term="development" /><category scheme="http://blog.mro.name" term="Cocoa" /><category scheme="http://blog.mro.name" term="CocoaHeads" /><category scheme="http://blog.mro.name" term="iPhone" /><category scheme="http://blog.mro.name" term="NSXMLParser" /><category scheme="http://blog.mro.name" term="ragel" /><category scheme="http://blog.mro.name" term="SVG" /><category scheme="http://blog.mro.name" term="Vortrag" /><category scheme="http://blog.mro.name" term="XML" />		<summary type="html"><![CDATA[
	Parser mit Ragel - komplizierte Grammatiken und rattenschnelles XML.
	Warum Parser bauen?
	Was spricht gegen Ad-Hoc Parsing (a.k.a. Gefrickel)?
	Quelltext Impression
	Wie komme ich drauf?
	Anschnallen: Die Bausteine
	Beispiel: SVG Path Parser
	Beispiel: XML Parser
	Ausblick: Zustandsautomaten
	Vielen Dank

Die Folien vom Vortrag am 22. September bei den CocoaHeads München.]]></summary>
		<content type="html" xml:base="http://blog.mro.name/2010/09/parser-mit-ragel/">&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="http://wiki.mro.name/cocoaheads/ragel#parser_mit_ragel"&gt;Parser mit Ragel&lt;/a&gt;&lt;/strong&gt; &amp;#8211; komplizierte Grammatiken und rattenschnelles XML.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://wiki.mro.name/cocoaheads/ragel#warum_parser_bauen"&gt;Warum Parser bauen?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://wiki.mro.name/cocoaheads/ragel#was_spricht_gegen_ad-hoc_parsing_aka_gefrickel"&gt;Was spricht gegen Ad-Hoc Parsing (a.k.a. Gefrickel)?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://wiki.mro.name/cocoaheads/ragel#quelltext_impression"&gt;Quelltext Impression&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://wiki.mro.name/cocoaheads/ragel#wie_komme_ich_drauf"&gt;Wie komme ich drauf?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://wiki.mro.name/cocoaheads/ragel#anschnallendie_bausteine"&gt;Anschnallen: Die Bausteine&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://wiki.mro.name/cocoaheads/ragel#beispielsvg_path_parser"&gt;Beispiel: SVG Path Parser&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://wiki.mro.name/cocoaheads/ragel#beispielxml_parser"&gt;Beispiel: XML Parser&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://wiki.mro.name/cocoaheads/ragel#ausblickzustandsautomaten"&gt;Ausblick: Zustandsautomaten&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://wiki.mro.name/cocoaheads/ragel#vielen_dank"&gt;Vielen Dank&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://wiki.mro.name/_export/s5/cocoaheads/ragel"&gt;Die Folien vom Vortrag am 22. September&lt;/a&gt; bei den &lt;a href="http://cocoaheads.org/de/Munich/"&gt;CocoaHeads München&lt;/a&gt;.&lt;/p&gt;
&lt;p class="wp-flattr-button"&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MRO-Blog/~4/1v_7VyrNQSQ" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://blog.mro.name/2010/09/parser-mit-ragel/#comments" thr:count="4" />
		<link rel="replies" type="application/atom+xml" href="http://blog.mro.name/2010/09/parser-mit-ragel/feed/atom/" thr:count="4" />
		<thr:total>4</thr:total>
	<feedburner:origLink>http://blog.mro.name/2010/09/parser-mit-ragel/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Marcus Rohrmoser</name>
						<uri>http://blog.mro.name</uri>
					</author>
		<title type="html"><![CDATA[UILabel with a (custom) CGFont]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MRO-Blog/~3/WfYFD5XyvgI/" />
		<id>http://blog.mro.name/?p=1935</id>
		<updated>2010-11-08T09:59:12Z</updated>
		<published>2010-08-26T16:05:18Z</published>
		<category scheme="http://blog.mro.name" term="Articles in english" /><category scheme="http://blog.mro.name" term="development" /><category scheme="http://blog.mro.name" term="CGFont" /><category scheme="http://blog.mro.name" term="Cocoa" /><category scheme="http://blog.mro.name" term="iOS" /><category scheme="http://blog.mro.name" term="iPhone" /><category scheme="http://blog.mro.name" term="Objective C" /><category scheme="http://blog.mro.name" term="OTF" /><category scheme="http://blog.mro.name" term="TrueType" /><category scheme="http://blog.mro.name" term="TTF" /><category scheme="http://blog.mro.name" term="UIFont" /><category scheme="http://blog.mro.name" term="UILabel" />		<summary type="html"><![CDATA[UILabel's font property accepts UIFonts - but strange enough there's no way to get a custom loaded CGFont (from a ttf or otf file) converted into such an UIFont. You're stuck with the iPhone's pre-installed fonts - at least when you have to support iOS 3.0 devices.

After googling a bit and searching Stackoverflow I found ...]]></summary>
		<content type="html" xml:base="http://blog.mro.name/2010/08/uilabel-with-a-custom-cgfont/">&lt;p&gt;&lt;a href="http://developer.apple.com/iphone/library/documentation/uikit/reference/UILabel_Class/Reference/UILabel.html#//apple_ref/doc/uid/TP40006797-CH3-SW5"&gt;UILabel&amp;#8217;s font property&lt;/a&gt; accepts &lt;a href="http://developer.apple.com/iphone/library/documentation/uikit/reference/UIFont_Class/Reference/Reference.html#//apple_ref/doc/c_ref/UIFont"&gt;UIFont&lt;/a&gt;s &amp;#8211; but strange enough there&amp;#8217;s no way to get a custom loaded &lt;a href="http://developer.apple.com/iphone/library/documentation/GraphicsImaging/Reference/CGFont/Reference/reference.html"&gt;CGFont&lt;/a&gt; (from a &lt;a href="http://en.wikipedia.org/wiki/TrueType"&gt;ttf&lt;/a&gt; or &lt;a href="http://en.wikipedia.org/wiki/OpenType"&gt;otf&lt;/a&gt; file) converted into such an UIFont. You&amp;#8217;re stuck with the iPhone&amp;#8217;s pre-installed fonts &amp;#8211; at least when you have to support iOS 3.0 devices.&lt;/p&gt;
&lt;p&gt;After googling a bit and searching &lt;a href="http://stackoverflow.com/questions/360751/can-i-embed-a-custom-font-in-an-iphone-application"&gt;Stackoverflow&lt;/a&gt; I found the solutions presented there not ideal or &lt;a href="http://github.com/zynga/FontLabel"&gt;great, but too heavy weight&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;So I inherited UILabel with a very lean custom class UILabelWithCGFont and overloaded it&amp;#8217;s &lt;a href="http://developer.apple.com/iphone/library/documentation/uikit/reference/UILabel_Class/Reference/UILabel.html#//apple_ref/doc/uid/TP40006797-CH3-SW10"&gt;drawTextInRect:&lt;/a&gt; method like this:&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="objc" style="font-family:monospace;"&gt;&lt;span style="color: #002200;"&gt;-&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #a61390;"&gt;void&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;drawTextInRect&lt;span style="color: #002200;"&gt;:&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;CGRect&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;rect
&lt;span style="color: #002200;"&gt;&amp;#123;&lt;/span&gt;
	MRLogD&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #bf1d1a;"&gt;@&lt;/span&gt;&lt;span style="color: #bf1d1a;"&gt;&amp;quot;(%f,%f) (%f,%f)&amp;quot;&lt;/span&gt;, rect.origin.x, rect.origin.y, rect.size.width, rect.size.height&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;;
	&lt;span style="color: #a61390;"&gt;if&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt; _CGFont &lt;span style="color: #002200;"&gt;==&lt;/span&gt; &lt;span style="color: #a61390;"&gt;NULL&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#123;&lt;/span&gt;
		&lt;span style="color: #002200;"&gt;&amp;#91;&lt;/span&gt;super drawTextInRect&lt;span style="color: #002200;"&gt;:&lt;/span&gt;rect&lt;span style="color: #002200;"&gt;&amp;#93;&lt;/span&gt;;
		&lt;span style="color: #a61390;"&gt;return&lt;/span&gt;;
	&lt;span style="color: #002200;"&gt;&amp;#125;&lt;/span&gt;
	NSAssert&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;_mapping &lt;span style="color: #002200;"&gt;!=&lt;/span&gt; &lt;span style="color: #a61390;"&gt;NULL&lt;/span&gt;, &lt;span style="color: #bf1d1a;"&gt;@&lt;/span&gt;&lt;span style="color: #bf1d1a;"&gt;&amp;quot;Mapping function pointer not set.&amp;quot;&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
	&lt;span style="color: #11740a; font-style: italic;"&gt;// prepare the target graphics context.&lt;/span&gt;
	&lt;span style="color: #a61390;"&gt;const&lt;/span&gt; CGContextRef ctx &lt;span style="color: #002200;"&gt;=&lt;/span&gt; UIGraphicsGetCurrentContext&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;;
	CGContextSaveGState&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;ctx&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;;
	&lt;span style="color: #002200;"&gt;&amp;#123;&lt;/span&gt;
		&lt;span style="color: #11740a; font-style: italic;"&gt;// prepare the glyphs array to draw&lt;/span&gt;
		&lt;span style="color: #a61390;"&gt;const&lt;/span&gt; &lt;span style="color: #400080;"&gt;NSString&lt;/span&gt; &lt;span style="color: #002200;"&gt;*&lt;/span&gt;txt &lt;span style="color: #002200;"&gt;=&lt;/span&gt; self.text;
		&lt;span style="color: #a61390;"&gt;const&lt;/span&gt; &lt;span style="color: #a61390;"&gt;size_t&lt;/span&gt; glyphCount &lt;span style="color: #002200;"&gt;=&lt;/span&gt; txt.length;
		CGGlyph glyphs&lt;span style="color: #002200;"&gt;&amp;#91;&lt;/span&gt;glyphCount&lt;span style="color: #002200;"&gt;&amp;#93;&lt;/span&gt;;
		&lt;span style="color: #002200;"&gt;&amp;#123;&lt;/span&gt;
			&lt;span style="color: #11740a; font-style: italic;"&gt;// turn the string txt into glyphs (indices into the font):&lt;/span&gt;
			&lt;span style="color: #11740a; font-style: italic;"&gt;// give non-allocating unicode character retrieval a try:&lt;/span&gt;
			&lt;span style="color: #a61390;"&gt;const&lt;/span&gt; UniChar &lt;span style="color: #002200;"&gt;*&lt;/span&gt;raw_unichars &lt;span style="color: #002200;"&gt;=&lt;/span&gt; CFStringGetCharactersPtr&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;CFStringRef&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;txt &lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;;
			&lt;span style="color: #a61390;"&gt;const&lt;/span&gt; UniChar &lt;span style="color: #002200;"&gt;*&lt;/span&gt;unichars &lt;span style="color: #002200;"&gt;=&lt;/span&gt; raw_unichars &lt;span style="color: #002200;"&gt;==&lt;/span&gt; &lt;span style="color: #a61390;"&gt;NULL&lt;/span&gt; ? &lt;span style="color: #a61390;"&gt;malloc&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt; glyphCount &lt;span style="color: #002200;"&gt;*&lt;/span&gt; &lt;span style="color: #a61390;"&gt;sizeof&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;UniChar&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #002200;"&gt;:&lt;/span&gt; raw_unichars;
			NSAssert&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;unichars &lt;span style="color: #002200;"&gt;!=&lt;/span&gt; &lt;span style="color: #a61390;"&gt;NULL&lt;/span&gt;, &lt;span style="color: #bf1d1a;"&gt;@&lt;/span&gt;&lt;span style="color: #bf1d1a;"&gt;&amp;quot;unichars not allocated&amp;quot;&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;;
			&lt;span style="color: #a61390;"&gt;if&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt; raw_unichars &lt;span style="color: #002200;"&gt;==&lt;/span&gt; &lt;span style="color: #a61390;"&gt;NULL&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;
				CFStringGetCharacters&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;CFStringRef&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;txt, CFRangeMake&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #2400d9;"&gt;0&lt;/span&gt;, txt.length&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;, &lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;UniChar &lt;span style="color: #002200;"&gt;*&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;unichars &lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;;
			&lt;span style="color: #a61390;"&gt;for&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt; &lt;span style="color: #a61390;"&gt;int&lt;/span&gt; i &lt;span style="color: #002200;"&gt;=&lt;/span&gt; glyphCount &lt;span style="color: #002200;"&gt;-&lt;/span&gt; &lt;span style="color: #2400d9;"&gt;1&lt;/span&gt;; i &lt;span style="color: #002200;"&gt;&amp;amp;&lt;/span&gt;gt;&lt;span style="color: #002200;"&gt;=&lt;/span&gt; &lt;span style="color: #2400d9;"&gt;0&lt;/span&gt;; i&lt;span style="color: #002200;"&gt;--&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;
				glyphs&lt;span style="color: #002200;"&gt;&amp;#91;&lt;/span&gt;i&lt;span style="color: #002200;"&gt;&amp;#93;&lt;/span&gt; &lt;span style="color: #002200;"&gt;=&lt;/span&gt; _mapping&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;unichars&lt;span style="color: #002200;"&gt;&amp;#91;&lt;/span&gt;i&lt;span style="color: #002200;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;;
			&lt;span style="color: #a61390;"&gt;if&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt; raw_unichars &lt;span style="color: #002200;"&gt;==&lt;/span&gt; &lt;span style="color: #a61390;"&gt;NULL&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;
				&lt;span style="color: #a61390;"&gt;free&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #a61390;"&gt;void&lt;/span&gt; &lt;span style="color: #002200;"&gt;*&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;unichars &lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;;
		&lt;span style="color: #002200;"&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
		CGContextSetFont&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;ctx, _CGFont&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;;
		CGContextSetFontSize&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;ctx, self.font.pointSize&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;;
		CGContextSetTextMatrix&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt; ctx, CGAffineTransformMake&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #2400d9;"&gt;1.0&lt;/span&gt;, &lt;span style="color: #2400d9;"&gt;0.0&lt;/span&gt;, &lt;span style="color: #2400d9;"&gt;0.0&lt;/span&gt;, &lt;span style="color: #002200;"&gt;-&lt;/span&gt;&lt;span style="color: #2400d9;"&gt;1.0&lt;/span&gt;, &lt;span style="color: #2400d9;"&gt;0.0&lt;/span&gt;, &lt;span style="color: #2400d9;"&gt;0.0&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
		&lt;span style="color: #11740a; font-style: italic;"&gt;// first print 'invisible' to measure size:&lt;/span&gt;
		CGContextSetTextDrawingMode&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;ctx, kCGTextInvisible&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;;
		&lt;span style="color: #a61390;"&gt;const&lt;/span&gt; CGPoint pre &lt;span style="color: #002200;"&gt;=&lt;/span&gt; CGContextGetTextPosition&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;ctx&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;;
		CGContextShowGlyphs&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;ctx, glyphs, glyphCount&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;;
		&lt;span style="color: #a61390;"&gt;const&lt;/span&gt; CGPoint post &lt;span style="color: #002200;"&gt;=&lt;/span&gt; CGContextGetTextPosition&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;ctx&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;;
		&lt;span style="color: #11740a; font-style: italic;"&gt;// restore text position&lt;/span&gt;
		CGContextSetTextPosition&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;ctx, pre.x, pre.y&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
		&lt;span style="color: #11740a; font-style: italic;"&gt;// centered horizontal + vertical:&lt;/span&gt;
		NSAssert&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #a61390;"&gt;int&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;rect.origin.x &lt;span style="color: #002200;"&gt;==&lt;/span&gt; &lt;span style="color: #2400d9;"&gt;0&lt;/span&gt;, &lt;span style="color: #bf1d1a;"&gt;@&lt;/span&gt;&lt;span style="color: #bf1d1a;"&gt;&amp;quot;origin.x not zero&amp;quot;&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;;
		NSAssert&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #a61390;"&gt;int&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;rect.origin.y &lt;span style="color: #002200;"&gt;==&lt;/span&gt; &lt;span style="color: #2400d9;"&gt;0&lt;/span&gt;, &lt;span style="color: #bf1d1a;"&gt;@&lt;/span&gt;&lt;span style="color: #bf1d1a;"&gt;&amp;quot;origin.y not zero&amp;quot;&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;;
		NSAssert&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;self.baselineAdjustment &lt;span style="color: #002200;"&gt;==&lt;/span&gt; UIBaselineAdjustmentAlignCenters, &lt;span style="color: #bf1d1a;"&gt;@&lt;/span&gt;&lt;span style="color: #bf1d1a;"&gt;&amp;quot;vertical alignment not 'center'&amp;quot;&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;;
		NSAssert&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;self.textAlignment &lt;span style="color: #002200;"&gt;==&lt;/span&gt; UITextAlignmentCenter, &lt;span style="color: #bf1d1a;"&gt;@&lt;/span&gt;&lt;span style="color: #bf1d1a;"&gt;&amp;quot;horizontal alignment not 'center'&amp;quot;&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;;
		&lt;span style="color: #a61390;"&gt;const&lt;/span&gt; CGPoint p &lt;span style="color: #002200;"&gt;=&lt;/span&gt; CGPointMake&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt; rect.size.width &lt;span style="color: #002200;"&gt;-&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;post.x &lt;span style="color: #002200;"&gt;-&lt;/span&gt; pre.x&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #002200;"&gt;/&lt;/span&gt; &lt;span style="color: #2400d9;"&gt;2&lt;/span&gt;, &lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;rect.size.height &lt;span style="color: #002200;"&gt;+&lt;/span&gt; self.font.pointSize &lt;span style="color: #002200;"&gt;+&lt;/span&gt; pre.y&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #002200;"&gt;/&lt;/span&gt; &lt;span style="color: #2400d9;"&gt;2&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
		&lt;span style="color: #11740a; font-style: italic;"&gt;// finally render it to the graphics context:&lt;/span&gt;
		CGContextSetTextDrawingMode&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;ctx, kCGTextFill&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;;
		CGContextSetFillColorWithColor&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;ctx, self.textColor.CGColor&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;;
		CGContextShowGlyphsAtPoint&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;ctx, p.x, p.y, glyphs, glyphCount&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;;
	&lt;span style="color: #002200;"&gt;&amp;#125;&lt;/span&gt;
	CGContextRestoreGState&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;ctx&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;;
&lt;span style="color: #002200;"&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Usage:&lt;/strong&gt; Just turn the UILabel instances in Interface Builder into UILabelWithCGFont and implement the &lt;a href="http://developer.apple.com/iphone/library/documentation/uikit/reference/UIViewController_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40006926-CH3-SW25"&gt;UIViewController::viewDidLoad&lt;/a&gt; method like this:&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="objc" style="font-family:monospace;"&gt;CGGlyph unicode2glyphDeutscheDruckschrift&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;UniChar c&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;
&lt;span style="color: #002200;"&gt;&amp;#123;&lt;/span&gt;
	&lt;span style="color: #a61390;"&gt;if&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt; &lt;span style="color: #bf1d1a;"&gt;'0'&lt;/span&gt; &amp;lt; &lt;span style="color: #002200;"&gt;=&lt;/span&gt; c &lt;span style="color: #002200;"&gt;&amp;amp;&amp;amp;&lt;/span&gt; c &amp;lt;&lt;span style="color: #002200;"&gt;=&lt;/span&gt; &lt;span style="color: #bf1d1a;"&gt;'9'&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;
		&lt;span style="color: #a61390;"&gt;return&lt;/span&gt; c &lt;span style="color: #002200;"&gt;+&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #2400d9;"&gt;16&lt;/span&gt; &lt;span style="color: #002200;"&gt;-&lt;/span&gt; &lt;span style="color: #bf1d1a;"&gt;'0'&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;;
	&lt;span style="color: #a61390;"&gt;if&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt; &lt;span style="color: #bf1d1a;"&gt;'A'&lt;/span&gt; &amp;lt;&lt;span style="color: #002200;"&gt;=&lt;/span&gt; c &lt;span style="color: #002200;"&gt;&amp;amp;&amp;amp;&lt;/span&gt; c &amp;lt;&lt;span style="color: #002200;"&gt;=&lt;/span&gt; &lt;span style="color: #bf1d1a;"&gt;'Z'&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;
		&lt;span style="color: #a61390;"&gt;return&lt;/span&gt; c &lt;span style="color: #002200;"&gt;+&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #2400d9;"&gt;32&lt;/span&gt; &lt;span style="color: #002200;"&gt;-&lt;/span&gt; &lt;span style="color: #bf1d1a;"&gt;'A'&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;;
	&lt;span style="color: #a61390;"&gt;if&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt; &lt;span style="color: #bf1d1a;"&gt;'a'&lt;/span&gt; &amp;lt;&lt;span style="color: #002200;"&gt;=&lt;/span&gt; c &lt;span style="color: #002200;"&gt;&amp;amp;&amp;amp;&lt;/span&gt; c &amp;lt;&lt;span style="color: #002200;"&gt;=&lt;/span&gt; &lt;span style="color: #bf1d1a;"&gt;'z'&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;
		&lt;span style="color: #a61390;"&gt;return&lt;/span&gt; c &lt;span style="color: #002200;"&gt;+&lt;/span&gt; &lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #2400d9;"&gt;58&lt;/span&gt; &lt;span style="color: #002200;"&gt;-&lt;/span&gt; &lt;span style="color: #bf1d1a;"&gt;'a'&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;;
	&lt;span style="color: #a61390;"&gt;return&lt;/span&gt; &lt;span style="color: #2400d9;"&gt;0&lt;/span&gt;;
&lt;span style="color: #002200;"&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #002200;"&gt;-&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #a61390;"&gt;void&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;viewDidLoad
&lt;span style="color: #002200;"&gt;&amp;#123;&lt;/span&gt;
	&lt;span style="color: #002200;"&gt;&amp;#91;&lt;/span&gt;super viewDidLoad&lt;span style="color: #002200;"&gt;&amp;#93;&lt;/span&gt;;
	...
	&lt;span style="color: #002200;"&gt;&amp;#91;&lt;/span&gt;fontLabel setFontFromFile&lt;span style="color: #002200;"&gt;:&lt;/span&gt;&lt;span style="color: #bf1d1a;"&gt;@&lt;/span&gt;&lt;span style="color: #bf1d1a;"&gt;&amp;quot;DeutscheDruckschrift&amp;quot;&lt;/span&gt; ofType&lt;span style="color: #002200;"&gt;:&lt;/span&gt;&lt;span style="color: #bf1d1a;"&gt;@&lt;/span&gt;&lt;span style="color: #bf1d1a;"&gt;&amp;quot;ttf&amp;quot;&lt;/span&gt; mapping&lt;span style="color: #002200;"&gt;:&lt;/span&gt;unicode2glyphDeutscheDruckschrift&lt;span style="color: #002200;"&gt;&amp;#93;&lt;/span&gt;;
	...
&lt;span style="color: #002200;"&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;See this &lt;a href="http://gist.github.com/551646"&gt;github gist&lt;/a&gt; for the complete implementation.&lt;/p&gt;
&lt;p&gt;The mapping from &lt;a href="http://unicode.org/"&gt;Unicode&lt;/a&gt; character codes to &lt;a href="http://en.wikipedia.org/wiki/Glyph"&gt;glyph&lt;/a&gt; indices (inside the &lt;a href="http://en.wikipedia.org/wiki/TrueType"&gt;font description&lt;/a&gt;) currently is done via a C mapping function you have to provide a &lt;a href="http://en.wikipedia.org/wiki/Function_pointer"&gt;function pointer&lt;/a&gt; for. A later implementation could map the unicode character code to the glyph name and leverage  &lt;a href="http://developer.apple.com/iphone/library/documentation/GraphicsImaging/Reference/CGFont/Reference/reference.html#//apple_ref/doc/uid/TP30000953-CH1g-SW13"&gt;CGFontGetGlyphWithGlyphName&lt;/a&gt; and render the custom mapping function obsolete.&lt;/p&gt;
&lt;p&gt;&lt;span id="more-1935"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;script src="http://gist.github.com/551646.js"&gt; &lt;/script&gt;&lt;/pre&gt;
&lt;p class="wp-flattr-button"&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MRO-Blog/~4/WfYFD5XyvgI" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://blog.mro.name/2010/08/uilabel-with-a-custom-cgfont/#comments" thr:count="3" />
		<link rel="replies" type="application/atom+xml" href="http://blog.mro.name/2010/08/uilabel-with-a-custom-cgfont/feed/atom/" thr:count="3" />
		<thr:total>3</thr:total>
	<feedburner:origLink>http://blog.mro.name/2010/08/uilabel-with-a-custom-cgfont/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Marcus Rohrmoser</name>
						<uri>http://blog.mro.name</uri>
					</author>
		<title type="html"><![CDATA[Visualise macports dependencies]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MRO-Blog/~3/U8F5uJETL5U/" />
		<id>http://blog.mro.name/?p=1927</id>
		<updated>2011-01-25T09:42:36Z</updated>
		<published>2010-08-15T16:12:04Z</published>
		<category scheme="http://blog.mro.name" term="sysadmin" /><category scheme="http://blog.mro.name" term="Graphviz" /><category scheme="http://blog.mro.name" term="MacPorts" /><category scheme="http://blog.mro.name" term="OS X" /><category scheme="http://blog.mro.name" term="Ruby" />		<summary type="html"><![CDATA[to clean up your installed macports and remove cruft you need to uninstall them in the correct order - according to their dependencies.

A graphical visualisation might help doing so:



Call
$ ./port-deps2dot.rb &#124; dot -Tpdf -o port-deps.pdf ; open port-deps.pdf
with the ruby script port-deps2dot.rb (github gist) as follows:
#!/usr/bin/ruby -w

# visualize macports dependencies.
# pipe the result through ...]]></summary>
		<content type="html" xml:base="http://blog.mro.name/2010/08/visualise-macports-dependencies/">&lt;p&gt;to clean up your installed macports and remove cruft you need to uninstall them in the correct order &amp;#8211; according to their dependencies.&lt;/p&gt;
&lt;p&gt;A graphical visualisation might help doing so:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blog.mro.name/wp-content/uploads/2010/08/port-deps.png"&gt;&lt;img class="aligncenter size-medium wp-image-1928" title="port-deps" src="http://blog.mro.name/wp-content/uploads/2010/08/port-deps-188x300.png" alt="" width="188" height="300" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Call&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="bash" style="font-family:monospace;"&gt;$ .&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;port-deps2dot.rb &lt;span style="color: #000000; font-weight: bold;"&gt;|&lt;/span&gt; dot &lt;span style="color: #660033;"&gt;-Tpdf&lt;/span&gt; &lt;span style="color: #660033;"&gt;-o&lt;/span&gt; port-deps.pdf ; open port-deps.pdf&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;with the ruby script &lt;a href="https://gist.github.com/794713"&gt;&lt;code&gt;port-deps2dot.rb&lt;/code&gt; (github gist)&lt;/a&gt; as follows:&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="ruby" style="font-family:monospace;"&gt;&lt;span style="color:#008000; font-style:italic;"&gt;#!/usr/bin/ruby -w&lt;/span&gt;
&amp;nbsp;
&lt;span style="color:#008000; font-style:italic;"&gt;# visualize macports dependencies.&lt;/span&gt;
&lt;span style="color:#008000; font-style:italic;"&gt;# pipe the result through graphviz, e.g.&lt;/span&gt;
&lt;span style="color:#008000; font-style:italic;"&gt;# $ ./port-deps2dot.rb | dot -Tpdf -o port-deps.pdf ; open port-deps.pdf&lt;/span&gt;
&amp;nbsp;
&lt;span style="color:#9966CC; font-weight:bold;"&gt;def&lt;/span&gt; scan_deps
	pat = &lt;span style="color:#006600; font-weight:bold;"&gt;/&lt;/span&gt;^&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#91;&lt;/span&gt;^:&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;+&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#41;&lt;/span&gt;:&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#40;&lt;/span&gt;.&lt;span style="color:#006600; font-weight:bold;"&gt;+&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#41;&lt;/span&gt;$&lt;span style="color:#006600; font-weight:bold;"&gt;/&lt;/span&gt;
	name = &lt;span style="color:#996600;"&gt;''&lt;/span&gt;
	deps = &lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#93;&lt;/span&gt;
	&lt;span style="color:#CC00FF; font-weight:bold;"&gt;IO&lt;/span&gt;.&lt;span style="color:#9900CC;"&gt;popen&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color:#996600;"&gt;'port info --name --pretty --depends installed'&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color:#9966CC; font-weight:bold;"&gt;do&lt;/span&gt; &lt;span style="color:#006600; font-weight:bold;"&gt;|&lt;/span&gt;f&lt;span style="color:#006600; font-weight:bold;"&gt;|&lt;/span&gt;
		f.&lt;span style="color:#9900CC;"&gt;each_line&lt;/span&gt; &lt;span style="color:#9966CC; font-weight:bold;"&gt;do&lt;/span&gt; &lt;span style="color:#006600; font-weight:bold;"&gt;|&lt;/span&gt;l&lt;span style="color:#006600; font-weight:bold;"&gt;|&lt;/span&gt;
			&lt;span style="color:#9966CC; font-weight:bold;"&gt;case&lt;/span&gt; l
				&lt;span style="color:#9966CC; font-weight:bold;"&gt;when&lt;/span&gt; &lt;span style="color:#006600; font-weight:bold;"&gt;/&lt;/span&gt;^&lt;span style="color:#006600; font-weight:bold;"&gt;--&lt;/span&gt;$&lt;span style="color:#006600; font-weight:bold;"&gt;/&lt;/span&gt;
					&lt;span style="color:#9966CC; font-weight:bold;"&gt;yield&lt;/span&gt; name, deps
					name = &lt;span style="color:#996600;"&gt;''&lt;/span&gt;
					deps = &lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#93;&lt;/span&gt;
				&lt;span style="color:#9966CC; font-weight:bold;"&gt;when&lt;/span&gt; &lt;span style="color:#006600; font-weight:bold;"&gt;/&lt;/span&gt;^&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#91;&lt;/span&gt;^:&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;+&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#41;&lt;/span&gt;:&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#40;&lt;/span&gt;.&lt;span style="color:#006600; font-weight:bold;"&gt;+&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#41;&lt;/span&gt;$&lt;span style="color:#006600; font-weight:bold;"&gt;/&lt;/span&gt;
					&lt;span style="color:#9966CC; font-weight:bold;"&gt;if&lt;/span&gt; &lt;span style="color:#996600;"&gt;'name'&lt;/span&gt; == &lt;span style="color:#996600;"&gt;&amp;quot;#$1&amp;quot;&lt;/span&gt;
						name = &lt;span style="color:#996600;"&gt;&amp;quot;#$2&amp;quot;&lt;/span&gt;.&lt;span style="color:#9900CC;"&gt;strip&lt;/span&gt;
					&lt;span style="color:#9966CC; font-weight:bold;"&gt;else&lt;/span&gt;
						deps.&lt;span style="color:#9900CC;"&gt;concat&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color:#996600;"&gt;&amp;quot;#$2&amp;quot;&lt;/span&gt;.&lt;span style="color:#CC0066; font-weight:bold;"&gt;split&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;/&lt;/span&gt;\s&lt;span style="color:#006600; font-weight:bold;"&gt;*&lt;/span&gt;,\s&lt;span style="color:#006600; font-weight:bold;"&gt;*/&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#41;&lt;/span&gt;
					&lt;span style="color:#9966CC; font-weight:bold;"&gt;end&lt;/span&gt;
				&lt;span style="color:#9966CC; font-weight:bold;"&gt;else&lt;/span&gt;
					&lt;span style="color:#CC0066; font-weight:bold;"&gt;raise&lt;/span&gt; &lt;span style="color:#996600;"&gt;&amp;quot;Fall-through for '#{l}'&amp;quot;&lt;/span&gt;
			&lt;span style="color:#9966CC; font-weight:bold;"&gt;end&lt;/span&gt;
		&lt;span style="color:#9966CC; font-weight:bold;"&gt;end&lt;/span&gt;
	&lt;span style="color:#9966CC; font-weight:bold;"&gt;end&lt;/span&gt;
&lt;span style="color:#9966CC; font-weight:bold;"&gt;end&lt;/span&gt;
&amp;nbsp;
all = &lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#123;&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
scan_deps &lt;span style="color:#9966CC; font-weight:bold;"&gt;do&lt;/span&gt; &lt;span style="color:#006600; font-weight:bold;"&gt;|&lt;/span&gt;name,deps&lt;span style="color:#006600; font-weight:bold;"&gt;|&lt;/span&gt;
	d = all&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#91;&lt;/span&gt;name&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#93;&lt;/span&gt;
	all&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#91;&lt;/span&gt;name&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#93;&lt;/span&gt; = d = &lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#93;&lt;/span&gt; &lt;span style="color:#9966CC; font-weight:bold;"&gt;if&lt;/span&gt; d.&lt;span style="color:#0000FF; font-weight:bold;"&gt;nil&lt;/span&gt;?
	deps.&lt;span style="color:#9900CC;"&gt;collect&lt;/span&gt;! &lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#123;&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;|&lt;/span&gt;i&lt;span style="color:#006600; font-weight:bold;"&gt;|&lt;/span&gt; i.&lt;span style="color:#9900CC;"&gt;strip&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#125;&lt;/span&gt;
	d.&lt;span style="color:#9900CC;"&gt;concat&lt;/span&gt; deps
	d.&lt;span style="color:#9900CC;"&gt;sort&lt;/span&gt;!
	d.&lt;span style="color:#9900CC;"&gt;uniq&lt;/span&gt;!
&lt;span style="color:#9966CC; font-weight:bold;"&gt;end&lt;/span&gt;
&amp;nbsp;
head = &lt;span style="color:#006600; font-weight:bold;"&gt;&amp;lt;&lt;/span&gt; &lt;span style="color:#006600; font-weight:bold;"&gt;&amp;lt;&lt;/span&gt;END_OF_STRING
&lt;span style="color:#008000; font-style:italic;"&gt;#!/usr/bin/dot -Tpdf -o port-deps.pdf&lt;/span&gt;
&lt;span style="color:#006600; font-weight:bold;"&gt;/*&lt;/span&gt;
	See http:&lt;span style="color:#006600; font-weight:bold;"&gt;//&lt;/span&gt;www.&lt;span style="color:#9900CC;"&gt;graphviz&lt;/span&gt;.&lt;span style="color:#9900CC;"&gt;org&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;/&lt;/span&gt;Documentation.&lt;span style="color:#9900CC;"&gt;php&lt;/span&gt;
&lt;span style="color:#006600; font-weight:bold;"&gt;*/&lt;/span&gt;
digraph &lt;span style="color:#996600;"&gt;&amp;quot;port deps&amp;quot;&lt;/span&gt; &lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#123;&lt;/span&gt;
	rankdir=LR;
    label=&lt;span style="color:#996600;"&gt;&amp;quot;port deps&amp;quot;&lt;/span&gt;;
    node &lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#91;&lt;/span&gt;style=filled,fillcolor=lightblue,shape=ellipse&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#93;&lt;/span&gt;;
    top_level &lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#91;&lt;/span&gt;shape=point&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#93;&lt;/span&gt;;
END_OF_STRING
&amp;nbsp;
&lt;span style="color:#CC0066; font-weight:bold;"&gt;puts&lt;/span&gt; head
&amp;nbsp;
all.&lt;span style="color:#9900CC;"&gt;keys&lt;/span&gt;.&lt;span style="color:#9900CC;"&gt;sort&lt;/span&gt;.&lt;span style="color:#9900CC;"&gt;each&lt;/span&gt; &lt;span style="color:#9966CC; font-weight:bold;"&gt;do&lt;/span&gt; &lt;span style="color:#006600; font-weight:bold;"&gt;|&lt;/span&gt;name&lt;span style="color:#006600; font-weight:bold;"&gt;|&lt;/span&gt;
	deps = all&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#91;&lt;/span&gt;name&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#93;&lt;/span&gt;
	&lt;span style="color:#9966CC; font-weight:bold;"&gt;if&lt;/span&gt; deps.&lt;span style="color:#9900CC;"&gt;count&lt;/span&gt; &lt;span style="color:#006600; font-weight:bold;"&gt;&amp;gt;&lt;/span&gt; &lt;span style="color:#006666;"&gt;0&lt;/span&gt;
		deps.&lt;span style="color:#9900CC;"&gt;each&lt;/span&gt; &lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#123;&lt;/span&gt;&lt;span style="color:#006600; font-weight:bold;"&gt;|&lt;/span&gt;d&lt;span style="color:#006600; font-weight:bold;"&gt;|&lt;/span&gt; &lt;span style="color:#CC0066; font-weight:bold;"&gt;puts&lt;/span&gt; &lt;span style="color:#996600;"&gt;&amp;quot;&lt;span style="color:#000099;"&gt;\t&lt;/span&gt;&lt;span style="color:#000099;"&gt;\&amp;quot;&lt;/span&gt;#{name}&lt;span style="color:#000099;"&gt;\&amp;quot;&lt;/span&gt; -&amp;gt; &lt;span style="color:#000099;"&gt;\&amp;quot;&lt;/span&gt;#{d}&lt;span style="color:#000099;"&gt;\&amp;quot;&lt;/span&gt;;&amp;quot;&lt;/span&gt; &lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#125;&lt;/span&gt;
	&lt;span style="color:#9966CC; font-weight:bold;"&gt;else&lt;/span&gt;
		&lt;span style="color:#CC0066; font-weight:bold;"&gt;puts&lt;/span&gt; &lt;span style="color:#996600;"&gt;&amp;quot;&lt;span style="color:#000099;"&gt;\t&lt;/span&gt;&lt;span style="color:#000099;"&gt;\&amp;quot;&lt;/span&gt;#{name}&lt;span style="color:#000099;"&gt;\&amp;quot;&lt;/span&gt;;&amp;quot;&lt;/span&gt;
	&lt;span style="color:#9966CC; font-weight:bold;"&gt;end&lt;/span&gt;
&lt;span style="color:#9966CC; font-weight:bold;"&gt;end&lt;/span&gt;
&amp;nbsp;
foot = &lt;span style="color:#006600; font-weight:bold;"&gt;&amp;lt;&lt;/span&gt; &lt;span style="color:#006600; font-weight:bold;"&gt;&amp;lt;&lt;/span&gt;END_OF_STRING
&lt;span style="color:#006600; font-weight:bold;"&gt;&amp;#125;&lt;/span&gt;
END_OF_STRING
&amp;nbsp;
&lt;span style="color:#CC0066; font-weight:bold;"&gt;puts&lt;/span&gt; foot&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;/pre&gt;
&lt;p class="wp-flattr-button"&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://blog.mro.name/?flattrss_redirect&amp;amp;id=1927&amp;amp;md5=86226d2207ff949b98460803a2bc7ceb" title="Flattr" target="_blank"&gt;&lt;img src="http://blog.mro.name/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MRO-Blog/~4/U8F5uJETL5U" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://blog.mro.name/2010/08/visualise-macports-dependencies/#comments" thr:count="3" />
		<link rel="replies" type="application/atom+xml" href="http://blog.mro.name/2010/08/visualise-macports-dependencies/feed/atom/" thr:count="3" />
		<thr:total>3</thr:total>
	<feedburner:origLink>http://blog.mro.name/2010/08/visualise-macports-dependencies/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Marcus Rohrmoser</name>
						<uri>http://blog.mro.name</uri>
					</author>
		<title type="html"><![CDATA[Develop with iOS 4 SDK on an OS 3.0 Device]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MRO-Blog/~3/1Edr44emxBA/" />
		<id>http://blog.mro.name/?p=1919</id>
		<updated>2010-06-23T11:32:27Z</updated>
		<published>2010-06-23T11:15:24Z</published>
		<category scheme="http://blog.mro.name" term="Articles in english" /><category scheme="http://blog.mro.name" term="development" /><category scheme="http://blog.mro.name" term="Base SDK" /><category scheme="http://blog.mro.name" term="Deployment Target" /><category scheme="http://blog.mro.name" term="Device" /><category scheme="http://blog.mro.name" term="iOS 4" /><category scheme="http://blog.mro.name" term="iPhone" /><category scheme="http://blog.mro.name" term="iPhone OS 3.0" /><category scheme="http://blog.mro.name" term="XCode" />		<summary type="html"><![CDATA[After upgrading to iOS 4.0 SDK, iPhone OS 3.0 is no longer a valid "Base SDK". Naively switching to iPhone 3.2 prevents deployment to a 3.0 device.

But such "Project -&#62; Edit Project Settings" work out fine:



"Deployment Target" hint found here.]]></summary>
		<content type="html" xml:base="http://blog.mro.name/2010/06/develop-with-ios-4-on-an-os-3-0-device/">&lt;p&gt;After upgrading to iOS 4.0 SDK, iPhone OS 3.0 is no longer a valid &amp;#8220;Base SDK&amp;#8221;. Naively switching to iPhone 3.2 prevents deployment to a 3.0 device.&lt;/p&gt;
&lt;p&gt;But such &amp;#8220;Project -&amp;gt; Edit Project Settings&amp;#8221; work out fine:&lt;/p&gt;
&lt;div id="attachment_1921" class="wp-caption aligncenter" style="width: 310px"&gt;&lt;a href="http://blog.mro.name/wp-content/uploads/2010/06/iPhoneOS3_0-device-with-iOS4_0-SDK.png"&gt;&lt;img class="size-medium wp-image-1921" title="iPhoneOS 3.0 development device with iOS 4.0 SDK" src="http://blog.mro.name/wp-content/uploads/2010/06/iPhoneOS3_0-device-with-iOS4_0-SDK-300x111.png" alt="iPhoneOS 3.0 development device with iOS 4.0 SDK" width="300" height="111" /&gt;&lt;/a&gt;&lt;p class="wp-caption-text"&gt;iPhoneOS 3.0 development device with iOS 4.0 SDK&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://forum.unity3d.com/viewtopic.php?p=335612"&gt;&amp;#8220;Deployment Target&amp;#8221; hint found here&lt;/a&gt;.&lt;/p&gt;
&lt;p class="wp-flattr-button"&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MRO-Blog/~4/1Edr44emxBA" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://blog.mro.name/2010/06/develop-with-ios-4-on-an-os-3-0-device/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://blog.mro.name/2010/06/develop-with-ios-4-on-an-os-3-0-device/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://blog.mro.name/2010/06/develop-with-ios-4-on-an-os-3-0-device/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Marcus Rohrmoser</name>
						<uri>http://blog.mro.name</uri>
					</author>
		<title type="html"><![CDATA[iOS 4 Simulator crash (when installed to custom folder)]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MRO-Blog/~3/8lTssV8Kobk/" />
		<id>http://blog.mro.name/?p=1917</id>
		<updated>2010-06-23T11:23:41Z</updated>
		<published>2010-06-23T10:42:11Z</published>
		<category scheme="http://blog.mro.name" term="Articles in english" /><category scheme="http://blog.mro.name" term="development" /><category scheme="http://blog.mro.name" term="crash" /><category scheme="http://blog.mro.name" term="iOS 4" /><category scheme="http://blog.mro.name" term="iPhone" /><category scheme="http://blog.mro.name" term="iPhone Simulator" /><category scheme="http://blog.mro.name" term="Softlink" /><category scheme="http://blog.mro.name" term="XCode" />		<summary type="html"><![CDATA[just downloaded and installed the iOS 4 SDK and as my root OS X partition is rather (too) small, I put it into a custom location /Users/Developer.Snowleopard/.

This causes the iPhone Simulator to crash and compiling gives an error like:

ibtool failed with exception: Interface Builder encountered an error communicating with the iPhone Simulator. If you ...]]></summary>
		<content type="html" xml:base="http://blog.mro.name/2010/06/ios-4-simulator-crash-when-installed-to-custom-folder/">&lt;p&gt;just downloaded and installed the iOS 4 SDK and as my root OS X partition is rather (too) small, I put it into a custom location /Users/Developer.Snowleopard/.&lt;/p&gt;
&lt;p&gt;This causes the iPhone Simulator to crash and compiling gives an error like:&lt;/p&gt;
&lt;pre&gt;ibtool failed with exception: Interface Builder encountered an error communicating with the iPhone Simulator. If you choose to file a crash report or radar for this issue, please check Console.app for crash reports for "Interface Builder Cocoa Touch Tool" and include their content in your crash report.
...
dyld: Library not loaded: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
  Referenced from: /Users/Developer.SnowLeopard/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib
  Reason: image not found&lt;/pre&gt;
&lt;p&gt;The cure &amp;#8211; a softlink:&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="bash" style="font-family:monospace;"&gt;$ &lt;span style="color: #c20cb9; font-weight: bold;"&gt;ln&lt;/span&gt; &lt;span style="color: #660033;"&gt;-s&lt;/span&gt; &lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Users&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Developer.SnowLeopard&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Platforms &lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Developer&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Platforms&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p class="wp-flattr-button"&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MRO-Blog/~4/8lTssV8Kobk" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://blog.mro.name/2010/06/ios-4-simulator-crash-when-installed-to-custom-folder/#comments" thr:count="1" />
		<link rel="replies" type="application/atom+xml" href="http://blog.mro.name/2010/06/ios-4-simulator-crash-when-installed-to-custom-folder/feed/atom/" thr:count="1" />
		<thr:total>1</thr:total>
	<feedburner:origLink>http://blog.mro.name/2010/06/ios-4-simulator-crash-when-installed-to-custom-folder/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Marcus Rohrmoser</name>
						<uri>http://blog.mro.name</uri>
					</author>
		<title type="html"><![CDATA[XCode: missing &#8220;deprecated&#8221; warnings]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MRO-Blog/~3/A_22hRbOa3w/" />
		<id>http://blog.mro.name/?p=1889</id>
		<updated>2010-06-23T09:23:34Z</updated>
		<published>2010-06-22T10:55:56Z</published>
		<category scheme="http://blog.mro.name" term="Articles in english" /><category scheme="http://blog.mro.name" term="development" /><category scheme="http://blog.mro.name" term="alloc" /><category scheme="http://blog.mro.name" term="compiler" /><category scheme="http://blog.mro.name" term="deprecated" /><category scheme="http://blog.mro.name" term="gcc" /><category scheme="http://blog.mro.name" term="initWithFrame" /><category scheme="http://blog.mro.name" term="iPhone" /><category scheme="http://blog.mro.name" term="Objective C" /><category scheme="http://blog.mro.name" term="UITableViewCell" /><category scheme="http://blog.mro.name" term="warning" /><category scheme="http://blog.mro.name" term="XCode" />		<summary type="html"><![CDATA[when developing for long-term use, you want to use APIs that aren't likely to be removed soon, a.k.a. "deprecated".

So, don't use downward compatible calls below a point you really aim for.

XCode helps with compiler warnings about "deprecated" calls - if "Project -&#62; Edit Project Settings -&#62; GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS" is set:



But be careful, this complains e.g. ...]]></summary>
		<content type="html" xml:base="http://blog.mro.name/2010/06/xcode-missing-deprecated-warnings/">&lt;p&gt;when developing for long-term use, you want to use APIs that aren&amp;#8217;t &lt;a href="http://en.wikipedia.org/wiki/Deprecation"&gt;likely to be removed soon, a.k.a. &amp;#8220;deprecated&amp;#8221;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;So, don&amp;#8217;t use downward compatible calls below a point you really aim for.&lt;/p&gt;
&lt;p&gt;XCode helps with compiler warnings about &amp;#8220;deprecated&amp;#8221; calls &amp;#8211; if &amp;#8220;Project -&amp;gt; Edit Project Settings -&amp;gt; GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS&amp;#8221; is set:&lt;/p&gt;
&lt;div id="attachment_1890" class="wp-caption aligncenter" style="width: 395px"&gt;&lt;a href="http://blog.mro.name/wp-content/uploads/2010/06/Bildschirmfoto-2010-06-22-um-12.39.48.png"&gt;&lt;img class="size-full wp-image-1890 " title="Compiler setting: Warn about deprecated calls" src="http://blog.mro.name/wp-content/uploads/2010/06/Bildschirmfoto-2010-06-22-um-12.39.48.png" alt="Compiler setting: Warn about deprecated calls" width="385" height="150" /&gt;&lt;/a&gt;&lt;p class="wp-caption-text"&gt;Compiler setting: Warn about deprecated calls&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;But be careful, this complains e.g. here only once while &lt;code&gt;&lt;a href="http://developer.apple.com/iphone/library/documentation/uikit/reference/UITableViewCell_Class/DeprecationAppendix/AppendixADeprecatedAPI.html#//apple_ref/doc/uid/TP40006938-CH3-SW32"&gt;initWithFrame:&lt;/a&gt;&lt;/code&gt; is also deprecated (compiling for iPhone OS 3.0):&lt;/p&gt;
&lt;div id="attachment_1891" class="wp-caption aligncenter" style="width: 310px"&gt;&lt;a href="http://blog.mro.name/wp-content/uploads/2010/06/Bildschirmfoto-2010-06-22-um-12.41.57.png"&gt;&lt;img class="size-medium wp-image-1891  " title="No &amp;quot;deprecated&amp;quot; warning on initXY" src="http://blog.mro.name/wp-content/uploads/2010/06/Bildschirmfoto-2010-06-22-um-12.41.57-300x14.png" alt="" width="300" height="14" /&gt;&lt;/a&gt;&lt;p class="wp-caption-text"&gt;No &amp;quot;deprecated&amp;quot; warning on initXY&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;As &lt;a href="http://stackoverflow.com/questions/2135514/deprecated-not-triggering-compiler-warning-with-subclass/2136130#comment-2076316"&gt;Kevin Ballard pointed out at Stackoverflow&lt;/a&gt;, this is because &lt;code&gt;[AnyClass alloc]&lt;/code&gt; returns a type &lt;code&gt;id&lt;/code&gt; &amp;#8211; which doesn&amp;#8217;t know about it&amp;#8217;s interface.&lt;/p&gt;
&lt;p&gt;To get this kind of compiler warnings, you have to type-cast the &lt;code&gt;[AnyClass alloc]&lt;/code&gt; like this:&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="objc" style="font-family:monospace;"&gt;&lt;span style="color: #002200;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#40;&lt;/span&gt;AnyClass&lt;span style="color: #002200;"&gt;*&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #002200;"&gt;&amp;#91;&lt;/span&gt;AnyClass alloc&lt;span style="color: #002200;"&gt;&amp;#93;&lt;/span&gt; initXY&lt;span style="color: #002200;"&gt;&amp;#93;&lt;/span&gt;;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Maybe time for a macro?&lt;/p&gt;
&lt;p&gt;The macro could look like&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="objc" style="font-family:monospace;"&gt;&lt;span style="color: #11740a; font-style: italic;"&gt;// http://blog.mro.name/2010/06/xcode-missing-deprecated-warnings/&lt;/span&gt;
&lt;span style="color: #6e371a;"&gt;#define alloc(c)	((c*)[c alloc])&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Migrate your codebase via XCode &amp;#8220;Edit -&amp;gt; Find in Project&amp;#8221; with search pattern &lt;code&gt;\[\s*([^\[\]]+)\s+alloc\s*\]&lt;/code&gt; and replacement pattern &lt;code&gt;alloc(\1)&lt;/code&gt;.&lt;/p&gt;
&lt;p class="wp-flattr-button"&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MRO-Blog/~4/A_22hRbOa3w" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://blog.mro.name/2010/06/xcode-missing-deprecated-warnings/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://blog.mro.name/2010/06/xcode-missing-deprecated-warnings/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://blog.mro.name/2010/06/xcode-missing-deprecated-warnings/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Marcus Rohrmoser</name>
						<uri>http://blog.mro.name</uri>
					</author>
		<title type="html"><![CDATA[Simple HTTP Access Authorisation]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MRO-Blog/~3/0hwhpm5G7Uw/" />
		<id>http://blog.mro.name/?p=1872</id>
		<updated>2010-06-14T10:56:49Z</updated>
		<published>2010-06-14T09:56:46Z</published>
		<category scheme="http://blog.mro.name" term="sysadmin" /><category scheme="http://blog.mro.name" term="apache" /><category scheme="http://blog.mro.name" term="authentication" /><category scheme="http://blog.mro.name" term="authorisation" /><category scheme="http://blog.mro.name" term="Basic Authentication" /><category scheme="http://blog.mro.name" term="Cram" /><category scheme="http://blog.mro.name" term="htaccess" /><category scheme="http://blog.mro.name" term="HTTPS" /><category scheme="http://blog.mro.name" term="mod_rewrite" /><category scheme="http://blog.mro.name" term="rest" /><category scheme="http://blog.mro.name" term="restful" /><category scheme="http://blog.mro.name" term="RewriteCond" /><category scheme="http://blog.mro.name" term="RewriteRule" />		<summary type="html"><![CDATA[sometimes you may want to lock down RESTful APIs or plain HTTP GET resources for authorised access by your own client software only, without requiring authentication. You don't know who (not authenticated), but you know she may access (is authorised).

If the server has a valid SSL certificate based on a root certificate pre-installed on the ...]]></summary>
		<content type="html" xml:base="http://blog.mro.name/2010/06/simple-http-access-authorisation/">&lt;p&gt;sometimes you may want to lock down &lt;a href="http://en.wikipedia.org/wiki/Representational_State_Transfer"&gt;RESTful APIs&lt;/a&gt; or plain HTTP GET resources for &lt;a href="http://en.wikipedia.org/wiki/Authorization"&gt;authorised access&lt;/a&gt; by your own client software only, without requiring &lt;a href="http://en.wikipedia.org/wiki/Authentication"&gt;authentication&lt;/a&gt;. You don&amp;#8217;t know who (not authenticated), but you know she may access (is authorised).&lt;/p&gt;
&lt;p&gt;If the server has a valid &lt;a href="http://httpd.apache.org/docs/2.0/ssl/ssl_faq.html"&gt;SSL certificate&lt;/a&gt; based on a root certificate pre-installed on the iPhone among the simplest ways to do it are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Basic_access_authentication"&gt;HTTP Basic Authentication&lt;/a&gt; with static username + password. This requires just a &lt;a href="http://httpd.apache.org/docs/2.0/mod/core.html#authtype"&gt;&lt;code&gt;.htaccess&lt;/code&gt; configuration setting&lt;/a&gt; and you&amp;#8217;re done.&lt;/li&gt;
&lt;li&gt;send a custom &lt;a href="http://www.w3.org/Protocols/HTTP/HTRQ_Headers.html"&gt;HTTP Request Header&lt;/a&gt; with a secret token, also just a &lt;code&gt;&lt;a href="http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html"&gt;.htaccess&lt;/a&gt;&lt;/code&gt;&lt;a href="http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html"&gt; rewrite&lt;/a&gt; setting required:

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="htaccess" style="font-family:monospace;"&gt;RewriteEngine On
RewriteCond %{HTTP:My-Secret-Token} !=WRdsWXwwTZjEIRrgD5tODVf0U
RewriteRule ^.*$ - [forbidden,last]
# Test: $  curl --header &amp;quot;My-Secret-Token:WRdsWXwwTZjEIRrgD5tODVf0U&amp;quot; http://myserver.example.com/demo/&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Decompiling an App may raise the bar high enough though hard-coded secrets surely aren&amp;#8217;t bulletproof Secret Service grade quality. If you don&amp;#8217;t want the password or secret token as literal string inside the App, synthesize it at runtime.&lt;/p&gt;
&lt;p&gt;If your transport channel isn&amp;#8217;t confidential (e.g. plain HTTP, not HTTPS) you might think about &lt;a href="http://en.wikipedia.org/wiki/Digest_access_authentication"&gt;Digest Authentication&lt;/a&gt; or a custom implemented &lt;a href="http://en.wikipedia.org/wiki/CRAM-MD5"&gt;CRAMish&lt;/a&gt; mechanism which I will not go into in this post.&lt;/p&gt;
&lt;p&gt;P.S.: &lt;a href="http://www.evolt.org/ultimate_htaccess_examples"&gt;Here are some really nice &lt;code&gt;.htaccess&lt;/code&gt; examples&lt;/a&gt;.&lt;/p&gt;
&lt;p class="wp-flattr-button"&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MRO-Blog/~4/0hwhpm5G7Uw" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://blog.mro.name/2010/06/simple-http-access-authorisation/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://blog.mro.name/2010/06/simple-http-access-authorisation/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://blog.mro.name/2010/06/simple-http-access-authorisation/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Marcus Rohrmoser</name>
						<uri>http://blog.mro.name</uri>
					</author>
		<title type="html"><![CDATA[Automatic gzip compression for Apache2 Webservers]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MRO-Blog/~3/30ouHzifDT4/" />
		<id>http://blog.mro.name/?p=1864</id>
		<updated>2010-06-13T11:55:25Z</updated>
		<published>2010-06-13T11:55:25Z</published>
		<category scheme="http://blog.mro.name" term="Articles in english" /><category scheme="http://blog.mro.name" term="sysadmin" /><category scheme="http://blog.mro.name" term="apache" /><category scheme="http://blog.mro.name" term="Debian" /><category scheme="http://blog.mro.name" term="gzip" /><category scheme="http://blog.mro.name" term="htaccess" /><category scheme="http://blog.mro.name" term="Linux" /><category scheme="http://blog.mro.name" term="mod_deflate" />		<summary type="html"><![CDATA[after failing and failing again in the last months, I finally got it with the help of http://www.debian-administration.org/articles/137

The .htaccess configuration
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/javascript
requires Apache's mod_deflate enabled via
$ a2enmod deflate
Module deflate installed; run /etc/init.d/apache2 force-reload to enable.
Check the result with http://www.gidnetwork.com/tools/gzip-test.php

Caution: There seems to be an If-Modified-Since/Last-Modified HTTP 304 bug in mod_deflate, ...]]></summary>
		<content type="html" xml:base="http://blog.mro.name/2010/06/automatic-gzip-compression-for-apache2-webservers/">&lt;p&gt;after failing and failing again in the last months, I finally got it with the help of &lt;a href="http://www.debian-administration.org/articles/137"&gt;http://www.debian-administration.org/articles/137&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;.htaccess&lt;/code&gt; configuration&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="htaccess" style="font-family:monospace;"&gt;AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/javascript&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;requires Apache&amp;#8217;s &lt;code&gt;mod_deflate&lt;/code&gt; enabled via&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="bash" style="font-family:monospace;"&gt;$ a2enmod deflate
Module deflate installed; run &lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;etc&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;init.d&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;apache2 force-reload to enable.&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Check the result with &lt;a href="http://www.gidnetwork.com/tools/gzip-test.php"&gt;http://www.gidnetwork.com/tools/gzip-test.php&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Caution:&lt;/strong&gt; There seems to be an &lt;a href="http://phpperformance.de/mod_gzip-mod_deflate-und-sonstige-komprimierungsverfahren-fuer-web-inhalte/#comment-17970"&gt;If-Modified-Since/Last-Modified HTTP 304 bug in mod_deflate&lt;/a&gt;, so better don&amp;#8217;t use it for large, rarely changing files.&lt;/p&gt;
&lt;p class="wp-flattr-button"&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MRO-Blog/~4/30ouHzifDT4" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://blog.mro.name/2010/06/automatic-gzip-compression-for-apache2-webservers/#comments" thr:count="1" />
		<link rel="replies" type="application/atom+xml" href="http://blog.mro.name/2010/06/automatic-gzip-compression-for-apache2-webservers/feed/atom/" thr:count="1" />
		<thr:total>1</thr:total>
	<feedburner:origLink>http://blog.mro.name/2010/06/automatic-gzip-compression-for-apache2-webservers/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Marcus Rohrmoser</name>
						<uri>http://blog.mro.name</uri>
					</author>
		<title type="html"><![CDATA[iPhone: libxml2 &amp; RELAX NG validation]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MRO-Blog/~3/2zRHqFVQVvo/" />
		<id>http://blog.mro.name/?p=1825</id>
		<updated>2010-06-14T12:37:40Z</updated>
		<published>2010-05-28T11:18:51Z</published>
		<category scheme="http://blog.mro.name" term="Articles in english" /><category scheme="http://blog.mro.name" term="development" /><category scheme="http://blog.mro.name" term="Apple" /><category scheme="http://blog.mro.name" term="Cocoa" /><category scheme="http://blog.mro.name" term="iPhone" /><category scheme="http://blog.mro.name" term="libxml2" /><category scheme="http://blog.mro.name" term="NSXMLParser" /><category scheme="http://blog.mro.name" term="RELAX NG" /><category scheme="http://blog.mro.name" term="SAX" /><category scheme="http://blog.mro.name" term="W3C" /><category scheme="http://blog.mro.name" term="XML" /><category scheme="http://blog.mro.name" term="xmllint" /><category scheme="http://blog.mro.name" term="xmlTextReader" />		<summary type="html"><![CDATA[Having a validating parser in place can reduce the required code to parse XML a lot - you know very well what you actually get. As mentioned in my last post about RELAX NG &#38; trang, I prefer RELAX NG over W3C XML Schema - which doesn't matter anyway because Apple's suggested XML parser ...]]></summary>
		<content type="html" xml:base="http://blog.mro.name/2010/05/iphone-libxml2-relax-ng-validation/">&lt;p&gt;Having a &lt;a href="http://www.w3.org/TR/REC-xml/#dt-valid"&gt;validating parser&lt;/a&gt; in place can reduce the required code to parse &lt;a href="http://en.wikipedia.org/wiki/XML"&gt;XML&lt;/a&gt; a lot &amp;#8211; you know very well what you actually get. As mentioned in my last post about &lt;a href="http://blog.mro.name/2010/05/xml-toolbox-relax-ng-trang/"&gt;RELAX NG &amp;amp; trang&lt;/a&gt;, I prefer &lt;a href="http://www.oasis-open.org/committees/relax-ng/"&gt;RELAX NG&lt;/a&gt; over &lt;a href="http://en.wikipedia.org/wiki/XML_Schema_(W3C)"&gt;W3C XML Schema&lt;/a&gt; &amp;#8211; which doesn&amp;#8217;t matter anyway because &lt;a href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Classes/NSXMLParser_Class/Reference/Reference.html"&gt;Apple&amp;#8217;s suggested XML parser&lt;/a&gt; doesn&amp;#8217;t validate at all.&lt;/p&gt;
&lt;p&gt;So we have to go one level deeper and have a look at &lt;a href="http://www.xmlsoft.org/"&gt;libxml2&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://developer.apple.com/iphone/library/samplecode/XMLPerformance/Listings/Classes_LibXMLParser_m.html#//apple_ref/doc/uid/DTS40008094-Classes_LibXMLParser_m-DontLinkElementID_10"&gt;Apple&amp;#8217;s example &amp;#8220;XmlPerformance&amp;#8221;&lt;/a&gt; helped to get started, but didn&amp;#8217;t do the trick because libxml2 allows validation for &lt;a href="http://www.xmlsoft.org/html/libxml-tree.html#xmlDocPtr"&gt;&lt;code&gt;xmlDocPtr&lt;/code&gt;&lt;/a&gt; or &lt;a href="http://www.xmlsoft.org/xmlreader.html"&gt;&lt;code&gt;xmlTextReader&lt;/code&gt;&lt;/a&gt; but not for &lt;a href="http://www.xmlsoft.org/html/libxml-tree.html#xmlSAXHandler"&gt;SAX parsers&lt;/a&gt; as used in the example.&lt;/p&gt;
&lt;p&gt;The &lt;a href="http://www.xmlsoft.org/examples/"&gt;libxml2 examples&lt;/a&gt; didn&amp;#8217;t help me too much either, but luckily there&amp;#8217;s &lt;a href="http://git.gnome.org/browse/libxml2/tree/xmllint.c#n2252"&gt;xmllint available in source&lt;/a&gt; (OSS just rocks) which does almost what we want. It first parses the XML into a &lt;code&gt;xmlDocPtr&lt;/code&gt; and validates afterwards &amp;#8211; and it does so for a reason:&lt;/p&gt;
&lt;p&gt;You can have a validating &lt;code&gt;xmlTextReader&lt;/code&gt; (via &lt;code&gt;&lt;a href="http://xmlsoft.org/html/libxml-xmlreader.html#xmlTextReaderRelaxNGSetSchema"&gt;xmlTextReaderRelaxNGSetSchema&lt;/a&gt;&lt;/code&gt;), but it won&amp;#8217;t detect &lt;a href="http://www.w3.org/TR/xmlschema-2/#IDREF"&gt;IDREF&lt;/a&gt;s missing their referred to &lt;a href="http://www.w3.org/TR/xmlschema-2/#ID"&gt;ID&lt;/a&gt; and the error messages lack the name of the failing item. BTW &amp;#8211; when validating against a &lt;a href="https://bugzilla.gnome.org/show_bug.cgi?id=170795"&gt;W3C schema this ID/IDREF check isn&amp;#8217;t available yet&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I finally discarded streaming XML parsing in favour of validation and &lt;a href="http://www.xmlsoft.org/examples/index.html#parse4.c"&gt;&amp;#8220;push&amp;#8221; parsing&lt;/a&gt; (nice for data coming in over the wire) and did:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="http://git.gnome.org/browse/libxml2/tree/xmllint.c#n3513"&gt;load the RELAX NG regular form schema (watch out for the assignment of &lt;code&gt;relaxngschemas&lt;/code&gt;)&lt;/a&gt; &amp;#8211; similar to xmllint schema loading,&lt;/li&gt;
&lt;li&gt;&lt;a href="http://git.gnome.org/browse/libxml2/tree/xmllint.c#n2252"&gt;push the raw XML data into a &lt;code&gt;xmlDocPtr&lt;/code&gt; (&lt;code&gt;xmlCreatePushParserCtxt&lt;/code&gt;)&lt;/a&gt; exactly like xmllint,&lt;/li&gt;
&lt;li&gt;&lt;a href="http://git.gnome.org/browse/libxml2/tree/xmllint.c#n2829"&gt;validate the in-memory document (&lt;code&gt;xmlRelaxNGValidateDoc&lt;/code&gt;)&lt;/a&gt;,&lt;/li&gt;
&lt;li&gt;&lt;a href="http://xmlsoft.org/html/libxml-xmlreader.html#xmlReaderWalker"&gt;turn it into a &lt;code&gt;xmlTextReader&lt;/code&gt;&lt;/a&gt;,&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.xmlsoft.org/xmlreader.html#Walking"&gt;process the reader&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Wrap up:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;if you want full RELAX NG validation with libxml2 v2.7.3, forget about streamed parsing,&lt;/li&gt;
&lt;li&gt;wrap the document into a &lt;code&gt;xmlTextReader&lt;/code&gt; if you want a SAXish programming model.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I may prepare and publish a &lt;code&gt;MroLibxml2Parser&lt;/code&gt; inheriting &lt;code&gt;&lt;a href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Classes/NSXMLParser_Class/Reference/Reference.html"&gt;NSXMLParser&lt;/a&gt;&lt;/code&gt; and firing it&amp;#8217;s callbacks in order to easily switch validating and non-validating parser implementations, but this has to wait a bit. Stay tuned.&lt;/p&gt;
&lt;p class="wp-flattr-button"&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MRO-Blog/~4/2zRHqFVQVvo" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://blog.mro.name/2010/05/iphone-libxml2-relax-ng-validation/#comments" thr:count="1" />
		<link rel="replies" type="application/atom+xml" href="http://blog.mro.name/2010/05/iphone-libxml2-relax-ng-validation/feed/atom/" thr:count="1" />
		<thr:total>1</thr:total>
	<feedburner:origLink>http://blog.mro.name/2010/05/iphone-libxml2-relax-ng-validation/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Marcus Rohrmoser</name>
						<uri>http://blog.mro.name</uri>
					</author>
		<title type="html"><![CDATA[XML Toolbox: RELAX NG &amp; trang]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MRO-Blog/~3/r347B9oe4jU/" />
		<id>http://blog.mro.name/?p=1771</id>
		<updated>2011-02-12T18:02:33Z</updated>
		<published>2010-05-21T20:10:25Z</published>
		<category scheme="http://blog.mro.name" term="Articles in english" /><category scheme="http://blog.mro.name" term="development" /><category scheme="http://blog.mro.name" term="Atom" /><category scheme="http://blog.mro.name" term="expat" /><category scheme="http://blog.mro.name" term="libxml2" /><category scheme="http://blog.mro.name" term="regular expression" /><category scheme="http://blog.mro.name" term="RELAX NG" /><category scheme="http://blog.mro.name" term="rest" /><category scheme="http://blog.mro.name" term="restful" /><category scheme="http://blog.mro.name" term="schema" /><category scheme="http://blog.mro.name" term="trang" /><category scheme="http://blog.mro.name" term="W3C" /><category scheme="http://blog.mro.name" term="XML" /><category scheme="http://blog.mro.name" term="xmllint" />		<summary type="html"><![CDATA[e.g. when handling RESTful APIs you may want to validate the response XML - a custom one in most cases.

I typically use tools already installed on every Mac and fire a http GET request with curl and immediately check it with xmllint like
$ curl http://www.heise.de/newsticker/heise-atom.xml &#124; xmllint --format --schema myschema.xsd -
But I just don't ...]]></summary>
		<content type="html" xml:base="http://blog.mro.name/2010/05/xml-toolbox-relax-ng-trang/">&lt;p&gt;e.g. when handling &lt;a href="http://en.wikipedia.org/wiki/Representational_State_Transfer"&gt;RESTful APIs&lt;/a&gt; you may want to &lt;a href="http://www.w3.org/TR/REC-xml/#dt-valid"&gt;validate&lt;/a&gt; the response &lt;a href="http://en.wikipedia.org/wiki/XML"&gt;XML&lt;/a&gt; &amp;#8211; a custom one in most cases.&lt;/p&gt;
&lt;p&gt;I typically use tools already installed on every Mac and fire a &lt;a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.3"&gt;http GET&lt;/a&gt; request with &lt;code&gt;&lt;a href="http://curl.haxx.se/"&gt;curl&lt;/a&gt;&lt;/code&gt; and immediately check it with &lt;code&gt;&lt;a href="http://xmlsoft.org/xmllint.html"&gt;xmllint&lt;/a&gt;&lt;/code&gt; like&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="bash" style="font-family:monospace;"&gt;$ curl http:&lt;span style="color: #000000; font-weight: bold;"&gt;//&lt;/span&gt;www.heise.de&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;newsticker&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;heise-atom.xml &lt;span style="color: #000000; font-weight: bold;"&gt;|&lt;/span&gt; xmllint &lt;span style="color: #660033;"&gt;--format&lt;/span&gt; &lt;span style="color: #660033;"&gt;--schema&lt;/span&gt; myschema.xsd -&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But I just don&amp;#8217;t like to create and edit &lt;a href="http://en.wikipedia.org/wiki/XML_Schema_(W3C)"&gt;W3C XML Schemas&lt;/a&gt; &amp;#8211; the notorious angle brackets hurt my eyes and the redundant element names hide the real stuff in tons of ever same text. Neither do I like to click through graphical schema editors and getting lost hunting for hidden settings and property dialogs.&lt;/p&gt;
&lt;p&gt;A minimal and naive schema validating the above example &lt;a href="http://www.ietf.org/rfc/rfc4287.txt"&gt;Atom&lt;/a&gt; feed (and simply created from the feed itself with trang, see below) as W3C Schema looks like this:&lt;/p&gt;
&lt;div id="attachment_1773" class="wp-caption aligncenter" style="width: 310px"&gt;&lt;a href="http://blog.mro.name/wp-content/uploads/2010/05/Bildschirmfoto-2010-05-21-um-21.05.49.png"&gt;&lt;img class="size-medium wp-image-1773" title="Naive Atom W3C Schema" src="http://blog.mro.name/wp-content/uploads/2010/05/Bildschirmfoto-2010-05-21-um-21.05.49-300x294.png" alt="Naive Atom W3C Schema" width="300" height="294" /&gt;&lt;/a&gt;&lt;p class="wp-caption-text"&gt;Naive Atom W3C Schema&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;Here comes in &lt;a href="http://en.wikipedia.org/wiki/RELAX_NG"&gt;RELAX NG&lt;/a&gt;, especially it&amp;#8217;s &amp;#8220;&lt;a href="http://relaxng.org/compact-tutorial-20030326.html"&gt;compact form&lt;/a&gt;&amp;#8220;, which is just what I like &amp;#8211; a concise, &lt;a href="http://en.wikipedia.org/wiki/Ebnf"&gt;BNF-ish&lt;/a&gt; syntax. It was designed by &lt;a href="http://en.wikipedia.org/wiki/Murata_Makoto"&gt;Murata Makoto&lt;/a&gt; and &lt;a href="http://www.jclark.com/"&gt;James Clark&lt;/a&gt;, Technical Lead of the XML Working Group back when XML was created and father of the famous &lt;a href="http://en.wikipedia.org/wiki/Expat_(XML)"&gt;expat parser&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The very same schema as above as RELAX NG boils down to ½ the lines and about ⅓ of the characters without a single angle bracket:&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="relaxng" style="font-family:monospace;"&gt;default namespace = &amp;quot;http://www.w3.org/2005/Atom&amp;quot;
&amp;nbsp;
start =
  element feed {
    title,
    element subtitle { text },
    link+,
    updated,
    element author {
      element name { text }
    },
    id,
    element entry { title, link, id, updated }+
  }
title = element title { text }
link =
  element link {
    attribute href { xsd:anyURI },
    attribute rel { xsd:NCName }?
  }
updated = element updated { xsd:dateTime }
id = element id { xsd:anyURI }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And as &lt;a href="http://xmlsoft.org/"&gt;libxml2&lt;/a&gt; and therefore xmllint supports RELAX NG, you can use the regular syntax to validate like in the beginning, but with a much more editable schema:&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="bash" style="font-family:monospace;"&gt;$ curl http:&lt;span style="color: #000000; font-weight: bold;"&gt;//&lt;/span&gt;www.heise.de&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;newsticker&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;heise-atom.xml &lt;span style="color: #000000; font-weight: bold;"&gt;|&lt;/span&gt; xmllint &lt;span style="color: #660033;"&gt;--format&lt;/span&gt; &lt;span style="color: #660033;"&gt;--relaxng&lt;/span&gt; myschema.rng -&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3&gt;&lt;a href="http://www.thaiopensource.com/relaxng/trang.html"&gt;trang&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;is a schema converter for RELAX NG written in Java which I wrapped inside a &lt;a href="http://en.wikipedia.org/wiki/Bash"&gt;bash&lt;/a&gt; script:&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="bash" style="font-family:monospace;"&gt;&lt;span style="color: #666666; font-style: italic;"&gt;#!/bin/sh&lt;/span&gt;
java &lt;span style="color: #660033;"&gt;-jar&lt;/span&gt; &lt;span style="color: #000000; font-weight: bold;"&gt;`&lt;/span&gt;&lt;span style="color: #c20cb9; font-weight: bold;"&gt;dirname&lt;/span&gt; &lt;span style="color: #007800;"&gt;$0&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;`/&lt;/span&gt;trang-&lt;span style="color: #000000;"&gt;20090818&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;trang.jar $&lt;span style="color: #000000; font-weight: bold;"&gt;@&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Writing a new schema from scratch can be much more convenient if you have a bunch of XML files you can feed into trang:&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="sh" style="font-family:monospace;"&gt;$ trang *.xml myschema.rnc&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;then refine the resulting schema in compact form and finally turn it into the regular form:&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="sh" style="font-family:monospace;"&gt;$ trang myschema.rnc myschema.rng&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Trang also serves me as a schema indenter by converting from compact to regular and back.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;BUT: trang converts RELAX NG into W3C but not vice versa.&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;Deep validation&lt;/h3&gt;
&lt;p&gt;Validating XML documents shouldn&amp;#8217;t stop with elements and attributes but rather leverage &lt;a href="http://www.w3.org/TR/xmlschema-2/#built-in-datatypes"&gt;XML Schema Datatypes&lt;/a&gt; and apply e.g. &lt;a href="http://en.wikipedia.org/wiki/Regular_expression"&gt;regular expressions&lt;/a&gt;&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="relaxng" style="font-family:monospace;"&gt;  element uuid {
    xsd:string {
&amp;nbsp;
      ## A UUID
      pattern =
        &amp;quot;[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}&amp;quot;
    }
  }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;or range constraints&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="relaxng" style="font-family:monospace;"&gt;        element year {
          xsd:unsignedShort { minInclusive = &amp;quot;1900&amp;quot; maxInclusive = &amp;quot;2100&amp;quot; }
        }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;P.S.: For a more complete Atom RELAX NG schema see &lt;a href="http://www.asahi-net.or.jp/~eb2m-mrt/atomextensions/atom.rnc"&gt;here&lt;/a&gt; or ask your search engine of choice.&lt;/p&gt;
&lt;p class="wp-flattr-button"&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://blog.mro.name/?flattrss_redirect&amp;amp;id=1771&amp;amp;md5=bfdf5c5fe0ad13e4d15c23b979c8c9c3" title="Flattr" target="_blank"&gt;&lt;img src="http://blog.mro.name/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MRO-Blog/~4/r347B9oe4jU" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://blog.mro.name/2010/05/xml-toolbox-relax-ng-trang/#comments" thr:count="4" />
		<link rel="replies" type="application/atom+xml" href="http://blog.mro.name/2010/05/xml-toolbox-relax-ng-trang/feed/atom/" thr:count="4" />
		<thr:total>4</thr:total>
	<feedburner:origLink>http://blog.mro.name/2010/05/xml-toolbox-relax-ng-trang/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Marcus Rohrmoser</name>
						<uri>http://blog.mro.name</uri>
					</author>
		<title type="html"><![CDATA[TextWrangler + tidy]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MRO-Blog/~3/8jQhy6eZ4dg/" />
		<id>http://blog.mro.name/?p=1751</id>
		<updated>2010-05-21T21:59:42Z</updated>
		<published>2010-05-17T09:30:14Z</published>
		<category scheme="http://blog.mro.name" term="Articles in english" /><category scheme="http://blog.mro.name" term="sysadmin" /><category scheme="http://blog.mro.name" term="bash" /><category scheme="http://blog.mro.name" term="html" /><category scheme="http://blog.mro.name" term="OS X" /><category scheme="http://blog.mro.name" term="TextWrangler" /><category scheme="http://blog.mro.name" term="tidy" /><category scheme="http://blog.mro.name" term="utf8" /><category scheme="http://blog.mro.name" term="xhtml" />		<summary type="html"><![CDATA[as I didn't get TidyService to work correctly with UTF8 umlauts, I created a UNIX Shell Script wrapper for html tidy as it comes with OS X that does the job at least for TextWrangler:

	open TextWranglers "Unix Filters Folder"
	create a file named e.g. "Tidy Html.sh",
	paste the following lines into the file and save it:
#!/bin/sh
# ...]]></summary>
		<content type="html" xml:base="http://blog.mro.name/2010/05/textwrangler-tidy/">&lt;p&gt;as I didn&amp;#8217;t get &lt;a href="http://www.pixelfreak.net/tidy_service/"&gt;TidyService&lt;/a&gt; to work correctly with &lt;a href="http://en.wikipedia.org/wiki/UTF-8"&gt;UTF8 umlauts&lt;/a&gt;, I created a &lt;a href="http://en.wikipedia.org/wiki/Bourne_shell"&gt;UNIX Shell Script&lt;/a&gt; wrapper for &lt;a href="http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man1/tidy.1.html"&gt;html tidy as it comes with OS X&lt;/a&gt; that does the job at least for &lt;a href="http://www.barebones.com/products/textwrangler/"&gt;TextWrangler&lt;/a&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;open TextWranglers &amp;#8220;Unix Filters Folder&amp;#8221;&lt;a style="text-decoration: none;" href="http://blog.mro.name/wp-content/uploads/2010/05/Bildschirmfoto-2010-05-17-um-11.15.12.png"&gt;&lt;img class="aligncenter size-medium wp-image-1752" title="Bildschirmfoto 2010-05-17 um 11.15.12" src="http://blog.mro.name/wp-content/uploads/2010/05/Bildschirmfoto-2010-05-17-um-11.15.12-300x211.png" alt="" width="300" height="211" /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;create a file named e.g. &amp;#8220;Tidy Html.sh&amp;#8221;,&lt;/li&gt;
&lt;li&gt;paste the following lines into the file and save it:

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="bash" style="font-family:monospace;"&gt;&lt;span style="color: #666666; font-style: italic;"&gt;#!/bin/sh&lt;/span&gt;
&lt;span style="color: #666666; font-style: italic;"&gt;# run &amp;quot;tidy&amp;quot; on the file given as 1st (and only) parameter.&lt;/span&gt;
&lt;span style="color: #666666; font-style: italic;"&gt;#&lt;/span&gt;
&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;usr&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;bin&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;tidy &lt;span style="color: #660033;"&gt;-utf8&lt;/span&gt; &lt;span style="color: #660033;"&gt;-asxhtml&lt;/span&gt; &lt;span style="color: #660033;"&gt;-indent&lt;/span&gt; &lt;span style="color: #660033;"&gt;-wrap&lt;/span&gt; &lt;span style="color: #000000;"&gt;100&lt;/span&gt; &lt;span style="color: #660033;"&gt;-quiet&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;&amp;quot;$1&amp;quot;&lt;/span&gt; &lt;span style="color: #000000;"&gt;2&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt; &lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;dev&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;null&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;/li&gt;
&lt;li&gt;now you can run &lt;a href="http://blog.mro.name/wp-content/uploads/2010/05/Bildschirmfoto-2010-05-20-um-20.25.44.png"&gt;&lt;img class="aligncenter size-medium wp-image-1764" title="Bildschirmfoto 2010-05-20 um 20.25.44" src="http://blog.mro.name/wp-content/uploads/2010/05/Bildschirmfoto-2010-05-20-um-02.25.44-300x206.png" alt="" width="300" height="206" /&gt;&lt;/a&gt;tidy on files opened in TextWrangler, even remote files.&lt;/li&gt;
&lt;li&gt;assign a keyboard shortcut (I used CTRL-T in the shot above) via the &amp;#8220;Unix Filters&amp;#8221; Palette:&lt;a href="http://blog.mro.name/wp-content/uploads/2010/05/Bildschirmfoto-2010-05-20-um-20.22.56.png"&gt;&lt;img class="aligncenter size-medium wp-image-1762" title="Bildschirmfoto 2010-05-20 um 20.22.56" src="http://blog.mro.name/wp-content/uploads/2010/05/Bildschirmfoto-2010-05-20-um-02.22.56-300x160.png" alt="" width="300" height="160" /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p class="wp-flattr-button"&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MRO-Blog/~4/8jQhy6eZ4dg" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://blog.mro.name/2010/05/textwrangler-tidy/#comments" thr:count="8" />
		<link rel="replies" type="application/atom+xml" href="http://blog.mro.name/2010/05/textwrangler-tidy/feed/atom/" thr:count="8" />
		<thr:total>8</thr:total>
	<feedburner:origLink>http://blog.mro.name/2010/05/textwrangler-tidy/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Marcus Rohrmoser</name>
						<uri>http://blog.mro.name</uri>
					</author>
		<title type="html"><![CDATA[Immo Betrug / Scam]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MRO-Blog/~3/y4svjb4bqgU/" />
		<id>http://blog.mro.name/?p=1738</id>
		<updated>2010-05-12T10:43:26Z</updated>
		<published>2010-05-12T10:20:42Z</published>
		<category scheme="http://blog.mro.name" term="Artikel auf deutsch" /><category scheme="http://blog.mro.name" term="offtopic" /><category scheme="http://blog.mro.name" term="Immo" /><category scheme="http://blog.mro.name" term="Nigeria" /><category scheme="http://blog.mro.name" term="Scam" />		<summary type="html"><![CDATA[auf Wohnungssuche begegnet man lustigen Sachen. Da war dieses extrem billige Angebot (2 Zi, 80m² für 550€) mit spannender Adresse, aber fragen kostet ja nix.

Die erste Mail der Anbieterin war dann:
Hi,

Thanks for your interest. The apartment is still available. I moved recently with my job in London, United Kingdom, but the rent is high ...]]></summary>
		<content type="html" xml:base="http://blog.mro.name/2010/05/immo-betrug-scam/">&lt;p&gt;auf Wohnungssuche begegnet man lustigen Sachen. Da war dieses extrem billige Angebot (2 Zi, 80m² für 550€) mit &lt;a href="http://maps.google.de/maps?f=q&amp;amp;source=s_q&amp;amp;hl=de&amp;amp;geocode=&amp;amp;q=karolinenplatz+3,+m%C3%BCnchen&amp;amp;sll=51.151786,10.415039&amp;amp;sspn=21.085965,36.606445&amp;amp;ie=UTF8&amp;amp;hq=&amp;amp;hnear=Karolinenplatz+3,+M%C3%BCnchen+80333+M%C3%BCnchen,+Bayern&amp;amp;t=h&amp;amp;z=18"&gt;spannender Adresse&lt;/a&gt;, aber fragen kostet ja nix.&lt;/p&gt;
&lt;p&gt;Die erste Mail der Anbieterin war dann:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks for your interest. The apartment is still available. I moved recently with my job in London, United Kingdom, but the rent is high here, I decided to offer to rent the apartment I have in Munchen . I rented the apartment for maximum 10 years &amp;#8230; This is the period that I have a contract here, but I can rent it for a shorter period also. I own the ground and is exactly as in the photos. The rent for 1 month is 550 EUR and does not include all the utilities you (water, electricity, Internet, cable). You can enter the apartment on the same day when receiving the keys .. The only problem is that i had to move with my job to United Kingdom, London where i am now and i left the keys and contract already signed by me at a company called Rent.com and they will handle the payment and delivery for us. If you want to know more about how this deal can work please get back to me ASAP and i will send you the details step by step. Thank you and hope to hear back from you.&lt;/p&gt;
&lt;p&gt;My German is limited at just a few words so i wish a lot to continue our conversation in English.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;dann ging&amp;#8217;s 2x per Mail hin und her,&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;If we decide to proceed with this transaction, I will have to contact Rent.com and provide them all the necessary information, so they can start the process right away. I will need your full name and address for that. You will receive a notification from Rent.com shortly after that, together with all the instructions to follow and the invoice as well.&lt;/p&gt;
&lt;p&gt;Regarding the payment, you will be instructed to deposit the money to a Rent.com account. They will hold and insure your money until you check the apartment and decide if you want take it or not. That is how their buyer protection policy works. As far as my concerns, I will be glad to know that Rent.com has the possession of the money during the delivery period. That is my insurance.&lt;/p&gt;
&lt;p&gt;As soon as the funds have been deposited into their account, they will immediately start the shipping process.&lt;/p&gt;
&lt;p&gt;The keys and rental contract will be delivered at your address in no more than 3 working days. You will be given a ten days inspection period from the day you receive the keys and contract at home. If you decide to hold the apartment, then you will have to authorize Rent.com to release the funds to me, and the transaction will be completed. If you will not be satisfied with the apartment, you will be able to send the keys and contract back through the same service and ask Rent.com to return the funds to you.&lt;/p&gt;
&lt;p&gt;Through I am sure you will love the apartment, it is good to know that you do have this second option available. If you wish to proceed with renting the apartment, please provide me your full name and address so I can initiate the deal through Rent.com right away.&lt;/p&gt;
&lt;p&gt;I am looking forward to hearing from you.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;die Anbieterin wollte nicht anrufen aber eine Zahlungsanweisung kam, die mich dann richtig stutizg machte, weil&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;der ganze Ablauf eh schon recht seltsam war,&lt;/li&gt;
&lt;li&gt;deren Absenderemail &amp;#8220;rentcom@consultant.com&amp;#8221; nicht mal von rent.com kam,&lt;a href="http://blog.mro.name/wp-content/uploads/2010/05/Bildschirmfoto-2010-05-12-um-12.11.41.png"&gt;&lt;img class="aligncenter size-medium wp-image-1740" title="Bildschirmfoto 2010-05-12 um 12.11.41" src="http://blog.mro.name/wp-content/uploads/2010/05/Bildschirmfoto-2010-05-12-um-12.11.41-251x300.png" alt="" width="251" height="300" /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;rent.com außerhalb USA gar nix macht,&lt;/li&gt;
&lt;li&gt;die &lt;a href="http://aruljohn.com/info/howtofindipaddress/#aol"&gt;Einlieferungs-IP&lt;/a&gt; der Zahlungsanweisung die gleiche wie die der Mails von der Anbieterin war,&lt;/li&gt;
&lt;li&gt;ja sogar &amp;#8220;In-Reply&amp;#8221; auf die vorherigen Mails,&lt;a href="http://blog.mro.name/wp-content/uploads/2010/05/Bildschirmfoto-2010-05-12-um-12.08.37.png"&gt;&lt;img class="aligncenter size-medium wp-image-1739" title="Bildschirmfoto 2010-05-12 um 12.08.37" src="http://blog.mro.name/wp-content/uploads/2010/05/Bildschirmfoto-2010-05-12-um-12.08.37-300x92.png" alt="" width="300" height="92" /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;das Geld an jemanden anderen gehen sollte,&lt;a style="text-decoration: none;" href="http://blog.mro.name/wp-content/uploads/2010/05/Bildschirmfoto-2010-05-12-um-12.24.10.png"&gt;&lt;img class="aligncenter size-medium wp-image-1746" title="Bildschirmfoto 2010-05-12 um 12.24.10" src="http://blog.mro.name/wp-content/uploads/2010/05/Bildschirmfoto-2010-05-12-um-12.24.10-300x131.png" alt="" width="300" height="131" /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;an der &lt;a href="http://maps.google.de/maps?f=q&amp;amp;source=s_q&amp;amp;hl=de&amp;amp;geocode=&amp;amp;q=karolinenplatz+3,+m%C3%BCnchen&amp;amp;sll=51.151786,10.415039&amp;amp;sspn=21.085965,36.606445&amp;amp;ie=UTF8&amp;amp;hq=&amp;amp;hnear=Karolinenplatz+3,+M%C3%BCnchen+80333+M%C3%BCnchen,+Bayern&amp;amp;t=h&amp;amp;z=18"&gt;Wohnungs-Adresse&lt;/a&gt; wohl gar keine Wohnungen sind,&lt;/li&gt;
&lt;li&gt;ein &lt;a href="http://aufgehts.wordpress.com/2010/05/12/augen-auf-beim-mietwohnungs-suchen/"&gt;Spezl&lt;/a&gt; mich auf die &lt;a href="http://www.rent.com/company/security/"&gt;Warnungen bei rent.com&lt;/a&gt; und einen &lt;a href="http://www.bbc.co.uk/blogs/watchdog/2008/10/flathunters_transfer_trap.html"&gt;Bericht bei der BBC&lt;/a&gt; hinwies.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Nach meiner Frage nach dem Namen des Hausmeisters war dann Funkstille in London.&lt;/p&gt;
&lt;p&gt;Zu guter letzt hat mich &lt;a href="http://aktuell.immobilienscout24.de/u/gm.php?prm=BEAgxe2VrU_116434665_159087_80916"&gt;Immoscout24 heute nochmal per Mail vor Betrügern gewarnt&lt;/a&gt;.&lt;/p&gt;
&lt;p class="wp-flattr-button"&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MRO-Blog/~4/y4svjb4bqgU" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://blog.mro.name/2010/05/immo-betrug-scam/#comments" thr:count="13" />
		<link rel="replies" type="application/atom+xml" href="http://blog.mro.name/2010/05/immo-betrug-scam/feed/atom/" thr:count="13" />
		<thr:total>13</thr:total>
	<feedburner:origLink>http://blog.mro.name/2010/05/immo-betrug-scam/</feedburner:origLink></entry>
	</feed>

