<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>Advogato blog for roozbeh</title>
    <link>http://www.advogato.org/person/roozbeh/</link>
    <description>Advogato blog for roozbeh</description>
    <language>en-us</language>
    <generator>mod_virgule</generator>
    <pubDate>Sat, 11 Oct 2008 14:25:24 GMT</pubDate>
    <item>
      <pubDate>Tue, 19 Feb 2008 23:08:38 GMT</pubDate>
      <title>19 Feb 2008</title>
      <link>http://www.advogato.org/person/roozbeh/diary.html?start=151</link>
      <guid>http://www.advogato.org/person/roozbeh/diary.html?start=151</guid>
      <description>&lt;strong&gt;Mentioned in Knuth:&lt;/strong&gt; My name is now mentioned&#xD;
in &lt;a href="http://catb.org/jargon/html/K/Knuth.html" &gt;Knuth&lt;/a&gt;!&#xD;
&#xD;
&lt;p&gt; It is in &lt;a href="http://www-cs-staff.stanford.edu/~uno/fasc1a.ps.gz" &gt;pre-fascicle&#xD;
1a, Bitwise Tricks and Techniques&lt;/a&gt; (PostScript, 1.1MiB):&#xD;
check the index for "Pournader, Roozbeh".&#xD;
&#xD;
&lt;p&gt; My contribution is a very small improvement on a UTF-8 bit&#xD;
manipulation trick I talked about in &lt;a href="http://advogato.org/person/roozbeh/diary/150.html" &gt;a&#xD;
former blog post&lt;/a&gt;.</description>
    </item>
    <item>
      <pubDate>Thu, 17 Jan 2008 15:22:19 GMT</pubDate>
      <title>17 Jan 2008</title>
      <link>http://www.advogato.org/person/roozbeh/diary.html?start=150</link>
      <guid>http://www.advogato.org/person/roozbeh/diary.html?start=150</guid>
      <description>&lt;strong&gt;Bit manipulation:&lt;/strong&gt; Ages ago, in October&#xD;
2005, &lt;a href="http://www.gnome.org/~federico/news-2005-10.html#31" &gt;Federico&#xD;
asked&lt;/a&gt; for improvements to a certain&#xD;
&lt;tt&gt;g_utf8_offset_to_pointer()&lt;/tt&gt; function.&#xD;
&#xD;
&lt;p&gt; This resulted in an optimization match by various people,&#xD;
which Behdad has somehow &lt;a href="http://mces.blogspot.com/2005/11/false-alarm-on-gutf8offsettopointer.html" &gt;summarized&#xD;
here&lt;/a&gt; (read also the comments).&#xD;
&#xD;
&lt;p&gt; Fast forward to December 2006, when I was going over &lt;a href="http://www.unicode.org/book/aboutbook.html" &gt;the new&#xD;
Unicode book&lt;/a&gt; and was trying to make sure Gnome and&#xD;
friends are Unicode compliant. One of the bugs I filed was&#xD;
&lt;a href="http://bugzilla.gnome.org/show_bug.cgi?id=391261" &gt;this&#xD;
one&lt;/a&gt;, and some of the answers I received somehow&#xD;
discouraged me from continuing the effort which basically&#xD;
led me to stop the whole thing. (The bug is about getting&#xD;
rid of legacy support for &lt;a href="http://tools.ietf.org/html/rfc2279" &gt;an old version of&#xD;
UTF-8&lt;/a&gt; which is&#xD;
now considered by the Unicode Standard to be a security&#xD;
problem.)&#xD;
&#xD;
&lt;p&gt; Then, last month I have been reading some &lt;a href="http://www-cs-faculty.stanford.edu/~knuth/news.html" &gt;draft&#xD;
material&lt;/a&gt; Donald Knuth is putting online, for his&#xD;
infamous Volume 4 of &lt;a href="http://en.wikipedia.org/wiki/The_Art_of_Computer_Programming" &gt;The&#xD;
Art of Computer Programming&lt;/a&gt;. One of the pre-fascicles he&#xD;
has put online is about &lt;a href="http://www-cs-faculty.stanford.edu/~knuth/fasc1a.ps.gz" &gt;Bitwise&#xD;
Tricks and Techniques&lt;/a&gt;, which I really enjoyed reading.&#xD;
Knuth, being a Unicode fan, had inserted some interesting&#xD;
excercises, regarding UTF-8 and UTF-16.&#xD;
&#xD;
&lt;p&gt; One of the exercises included a magic (!) formula to replace&#xD;
the &lt;tt&gt;utf8_skip_data&lt;/tt&gt; array (see Federico's post&#xD;
again). It is provided in exercise&amp;nbsp;197.&#xD;
&#xD;
&lt;p&gt; Knuth's formula not only needs no memory reference, it's&#xD;
also branch-free (which is considered very good for many&#xD;
modern CPU architectures). The formula does it with four&#xD;
operations, which would become five when adapted to the&#xD;
present formulation used in glib. The only problem is that&#xD;
it only works for proper UTF-8, the version the Unicode&#xD;
Standard requires, but not glib's UTF-8.&#xD;
&#xD;
&lt;p&gt; I tried to extend Knuth's formula to glib's UTF-8, and did&#xD;
it on paper with two more operations (seven instead of&#xD;
five), using 64-bit boolean arithmetic.&#xD;
&#xD;
&lt;p&gt; After chatting with Behdad, he told me it's not really worth&#xD;
it to replace the array with the formula (I cannot&#xD;
understand the reasons well enough to explain them here, but&#xD;
I trust him), but he was interested in seeing my extended&#xD;
formula.&#xD;
&#xD;
&lt;p&gt; So last night, I tried to make sure my formula works fine&#xD;
before emailing it to Behdad. And I found a bug, which meant&#xD;
that I needed to add two more operations to get it done&#xD;
properly, a total of nine operations.&#xD;
&#xD;
&lt;p&gt; This is my new formula, which is tested and works fine. It&#xD;
may not provide exactly the same results as the&#xD;
&lt;tt&gt;utf8_skip_data&lt;/tt&gt; array for all values, but many of&#xD;
the array's cells are redundant. For necessary cells, it&#xD;
provides the same results:&#xD;
&lt;pre&gt;&#xD;
def utf8_skipper(c):&#xD;
  t = (c &amp;gt;&amp;gt; 1)^0x7F&#xD;
  return ((0x924900009201B128 &amp;gt;&amp;gt; ((t &amp;amp; ~(t&#xD;
&amp;gt;&amp;gt; 1))*3)) &amp;amp; 7)+1&#xD;
&lt;/pre&gt;&#xD;
&#xD;
&lt;p&gt; Can you do it in less that nine operations? Or with 32-bit&#xD;
boolean arithmetic only? [With no branching or memory&#xD;
access, of course.]&#xD;
&#xD;
&lt;p&gt; This may just be a mental exercise, but please email me if&#xD;
you could, as I'm starting to feel an affection towards the&#xD;
problem!&#xD;
</description>
    </item>
    <item>
      <pubDate>Tue, 30 Oct 2007 11:14:56 GMT</pubDate>
      <title>30 Oct 2007</title>
      <link>http://www.advogato.org/person/roozbeh/diary.html?start=149</link>
      <guid>http://www.advogato.org/person/roozbeh/diary.html?start=149</guid>
      <description>&lt;strong&gt;The Middle Eastern view:&lt;/strong&gt; The stand-up&#xD;
comedian &lt;a href="http://www.mazjobrani.com/" &gt;Maz&#xD;
Jobrani&lt;/a&gt; talks about the Middle Eastern view in his &lt;a&#xD;
href="http://www.axisofevilcomedy.com/"&gt;Axis of Evil Comedy&#xD;
Tour&lt;/a&gt;. He says that he knew what would happen when he&#xD;
watched &lt;a&#xD;
href="http://en.wikipedia.org/wiki/Zidane#Confrontation_with_Marco_Materazzi"&gt;Zinedine&#xD;
Zidane headbutt Materazzi&lt;/a&gt;: He knew that some French&#xD;
people that considered Zidane one of themselves, would&#xD;
suddenly start to say: &amp;ldquo;This fucking guy&amp;rsquo;s&#xD;
Alegerian!&amp;rdquo;&#xD;
&#xD;
&lt;p&gt; So, I just wish to share my own Middle Eastern view. I just&#xD;
read &lt;a&#xD;
href="http://yro.slashdot.org/article.pl?sid=07/10/29/1833227"&gt;the&#xD;
story on slashdot&lt;/a&gt; about a guy buying a hard drive,&#xD;
finding that it contains bathroom tiles, and having problems&#xD;
returning it. What I immediately thought was: &amp;ldquo;He did&#xD;
it himself!&amp;rdquo; I read more, and I saw that many people&#xD;
consider him honest and a victim, which was also what I came&#xD;
to after reading the comments.&#xD;
&#xD;
&lt;p&gt; The sad point is, unfortunately, lots of Iranian&#xD;
muslims lie very easily, and even enjoy it, although&#xD;
it&amp;rsquo;s something that&amp;rsquo;s very frowned upon in &lt;a&#xD;
href="http://en.wikipedia.org/wiki/Qur'an"&gt;the scripture&lt;/a&gt;&#xD;
and &lt;a href="http://en.wikipedia.org/wiki/Hadith" &gt;the&#xD;
sayings&lt;/a&gt;. Even very religious muslims who own shops in&#xD;
the &lt;i&gt;bazaar&lt;/i&gt; and contribute heavily to religious causes&#xD;
like building mosques, lie very easily about everything and&#xD;
even pose as victims. So in this case, I automatically&#xD;
thought that the victim had done it himself, because I had&#xD;
got used to such deceptive self-victimizations. Ah, before I&#xD;
forget, I believe President Ahmadinejad leads them all!&#xD;
&#xD;
&lt;p&gt; Not that the story has much similarity with Maz&#xD;
Jobrani&amp;rsquo;s, just that suddenly a Middle&#xD;
Easterner&amp;rsquo;s view of an event or a story may be so&#xD;
different from the rest of the world&amp;rsquo;s.&#xD;
&#xD;
&lt;p&gt; By the way, I also found &lt;a&#xD;
href="http://yro.slashdot.org/comments.pl?sid=343527&amp;cid=21161003"&gt;a&#xD;
wonderful quote&lt;/a&gt; in the slashdot comments: &amp;ldquo;I was&#xD;
tired of North Korea&amp;rsquo;s harsh penalties for being a&#xD;
citizen. That&amp;rsquo;s why I moved to Iran!&amp;rdquo;&#xD;
</description>
    </item>
    <item>
      <pubDate>Tue, 9 Oct 2007 13:40:03 GMT</pubDate>
      <title>9 Oct 2007</title>
      <link>http://www.advogato.org/person/roozbeh/diary.html?start=148</link>
      <guid>http://www.advogato.org/person/roozbeh/diary.html?start=148</guid>
      <description>&lt;strong&gt;Che:&lt;/strong&gt; Here&amp;rsquo;s a great way to celebrate&#xD;
Che&amp;rsquo;s death anniversary: &lt;a&#xD;
href="http://www.lonelyplanet.com/blogs/travel_blog/2007/10/any-idea-where-i-can-get-my-hands-on.html"&gt;Where&#xD;
are the Rosa Luxemburg t-shirts?&lt;/a&gt;&#xD;
&#xD;
&lt;p&gt; In other news, apparently access to &lt;a&#xD;
href="http://utf-8.blogspot.com/"&gt;my Persian weblog&lt;/a&gt; (not&#xD;
updated for quite a while) is blocked by some (but not all)&#xD;
Iranian ISPs. My mother-in-law found about it, when she was&#xD;
searching my name in Google, and then called Elnaz, my wife:&#xD;
&amp;ldquo;There were so many hits for Roozbeh, but his website&#xD;
was filtered!&amp;rdquo;</description>
    </item>
    <item>
      <pubDate>Sun, 9 Sep 2007 15:14:11 GMT</pubDate>
      <title>9 Sep 2007</title>
      <link>http://www.advogato.org/person/roozbeh/diary.html?start=147</link>
      <guid>http://www.advogato.org/person/roozbeh/diary.html?start=147</guid>
      <description>&lt;strong&gt;OOXML:&lt;/strong&gt; I&amp;rsquo;m still tired from a&#xD;
one-week Turkey trip, in the middle of which I was supposed&#xD;
to finalize the drafting of comments to accompany&#xD;
Iran&amp;rsquo;s No vote to OOXML. Hard work for which some&#xD;
shameless people are trying to claim credit for...&#xD;
&#xD;
&lt;p&gt; I will write about the adventurous Turkey trip as soon as I&#xD;
can. It&amp;rsquo;s quite a entertaining story, considering all&#xD;
the disasters that happened to us. Also more on OOXML later.&#xD;
</description>
    </item>
    <item>
      <pubDate>Sat, 16 Jun 2007 15:31:25 GMT</pubDate>
      <title>16 Jun 2007</title>
      <link>http://www.advogato.org/person/roozbeh/diary.html?start=146</link>
      <guid>http://www.advogato.org/person/roozbeh/diary.html?start=146</guid>
      <description>&lt;strong&gt;Teaching:&lt;/strong&gt; My brother Behnam teaches&#xD;
GNU/Linux and various software that usually come with it,&#xD;
specially server-related applications. A week ago, after he&#xD;
had talked about an hour about how yum works, how to use it,&#xD;
and how to install a certain piece of software (let's call&#xD;
it FreeFoo) that the students were being taught about (on&#xD;
Fedora and with yum), a student asked a question:&#xD;
&#xD;
&lt;p&gt; &lt;blockquote&gt;&#xD;
&lt;b&gt;Student:&lt;/b&gt; I was wondering if you would&#xD;
please give us&#xD;
a copy of the FreeFoo software you just installed on the&#xD;
computer?&#xD;
&#xD;
&lt;p&gt; &lt;b&gt;Behnam:&lt;/b&gt; But I don&amp;rsquo;t have anything apart from&#xD;
the OS installation CDs, of which you have copies. The&#xD;
application yum does all the rest.&#xD;
&#xD;
&lt;p&gt; &lt;b&gt;Student:&lt;/b&gt; But you just installed it! You should have a&#xD;
CD somewhere.&#xD;
&#xD;
&lt;p&gt; &lt;b&gt;Behnam:&lt;/b&gt; It&amp;rsquo;s installed off the Internet, as I&#xD;
told you.&#xD;
&lt;/blockquote&gt;&#xD;
And then Behnam explains again for half an hour how yum works.&#xD;
&lt;blockquote&gt;&#xD;
&lt;b&gt;Student:&lt;/b&gt; [not believing him] Ah, still, would&#xD;
you give us a copy if you have one on you?&#xD;
&lt;/blockquote&gt;</description>
    </item>
    <item>
      <pubDate>Sat, 9 Jun 2007 12:58:28 GMT</pubDate>
      <title>9 Jun 2007</title>
      <link>http://www.advogato.org/person/roozbeh/diary.html?start=145</link>
      <guid>http://www.advogato.org/person/roozbeh/diary.html?start=145</guid>
      <description>&lt;strong&gt;Holidays:&lt;/strong&gt; Working at your own (and a bunch&#xD;
of friends&amp;rsquo;) company means that arranging holidays&#xD;
with friends will be easier and harder at the same time. But&#xD;
we did it anyway. I am just back from a road trip across&#xD;
Iran, going from Tehran to Qazvin to Zanjan to Tabriz to&#xD;
Kandovan to Jolfa to Kaleybar to Ardebil to Astara to Chalus&#xD;
and then back to Tehran. There were seven of us, five&#xD;
Iranians and two Irishmen, one of them Michael Everson (&lt;a&#xD;
href="http://www.evertype.com/blog/"&gt;blog&lt;/a&gt;, &lt;a&#xD;
href="http://en.wikipedia.org/wiki/Michael_Everson"&gt;wikipedia&#xD;
article&lt;/a&gt;), whom I have worked with on quite a few&#xD;
character encoding proposals for the Unicode Standard.&#xD;
&#xD;
&lt;p&gt; Among the most interesting parts of the trip, was going to&#xD;
the &lt;a&#xD;
href="http://en.wikipedia.org/wiki/Babak_Castle"&gt;Babak&#xD;
Fort&lt;/a&gt; during a very mysty day when we couldn&amp;rsquo;t see&#xD;
more than five meters around. Michael remained in the car,&#xD;
and tried to decode the joining and shaping behavior of the&#xD;
&lt;a&#xD;
href="http://www.iranica.com/newsite/articles/sup/Pahlavi_Psalter.html"&gt;Psalter&#xD;
Pahlavi script&lt;/a&gt;, a script that is only found in a fourth&#xD;
century CE twelve-page document (and also recently on a&#xD;
damaged cross found around Herat). We, the others, tried to&#xD;
find the path to the castle in the mist and was lost after&#xD;
twenty&#xD;
minutes, trying to find the coordinates of the castle by&#xD;
phoning friends and asking them to dig Google Earth and&#xD;
other friends with GPS devices but seeing no success, and&#xD;
then finally finding our way by Christian (our other Irish&#xD;
guest) hearing a loud radio playing in Azerbaijani which we&#xD;
followed and resulted in us getting found.&#xD;
&#xD;
&lt;p&gt; I&amp;rsquo;m looking forward to mapping the route to the castle&#xD;
on &lt;a&#xD;
href="http://www.openstreetmaps.org/"&gt;OSM&lt;/a&gt;.&#xD;
</description>
    </item>
    <item>
      <pubDate>Thu, 15 Mar 2007 15:50:17 GMT</pubDate>
      <title>15 Mar 2007</title>
      <link>http://www.advogato.org/person/roozbeh/diary.html?start=144</link>
      <guid>http://www.advogato.org/person/roozbeh/diary.html?start=144</guid>
      <description>&lt;strong&gt;Family:&lt;/strong&gt; Today, my grandfather died at the&#xD;
age of eighty-three, fifteen minutes before when me and&#xD;
Elnaz were supposed to arrive at his home to visit him and&#xD;
wish him well-being. It was so sad, to miss him like this.&#xD;
&#xD;
&lt;p&gt; My mom was at his death bed, and held him when he died. He&#xD;
was very well aware of what happened around him until the&#xD;
final moments, but had a hard time talking and moving in his&#xD;
last week. For all I know, he wished to die sooner, as he&#xD;
perhaps could not stand himself being weak. His mental image&#xD;
of himself was always a strong and clear-minded man, which&#xD;
was breaking after his illness after a few heart attacks he&#xD;
survived.&#xD;
&#xD;
&lt;p&gt; He is the nearest person I have lost to death. I tried my&#xD;
best to not look at his corpse, hoping that the avoiding&#xD;
will help me keep a better last image of him in my memory.&#xD;
&#xD;
&lt;p&gt; I had written here about him previously, on &lt;a&#xD;
href="http://advogato.org/person/roozbeh/diary.html?start=132"&gt;a&#xD;
note about Rumsfeld&lt;/a&gt;.&#xD;
</description>
    </item>
    <item>
      <pubDate>Sat, 10 Mar 2007 11:33:04 GMT</pubDate>
      <title>10 Mar 2007</title>
      <link>http://www.advogato.org/person/roozbeh/diary.html?start=143</link>
      <guid>http://www.advogato.org/person/roozbeh/diary.html?start=143</guid>
      <description>&lt;strong&gt;Maps:&lt;/strong&gt; A Persian map of the area surrounding&#xD;
&lt;a href="http://www.sharif.edu/" &gt;Sharif University of&#xD;
Technology&lt;/a&gt; in Tehran (which Farzaneh and me have mapped)&#xD;
is now image of the week on &lt;a&#xD;
href="http://www.openstreetmap.org/"&gt;OpenStreetMap&lt;/a&gt; and&#xD;
appears on the project&amp;rsquo;s front page. Nice!&#xD;
&#xD;
&lt;p&gt; OSM&amp;rsquo;s infrastructure is great, but more mappers&#xD;
and developers are definitely needed and are quite welcome.&#xD;
Getting involved in the project is highly recommended if you&#xD;
love maps, own a GPS device, or like trying your hand on&#xD;
hacking map-related software like map renderers and route&#xD;
finders.&#xD;
&#xD;
&lt;p&gt; For us, it&amp;rsquo;s a unique opportunity to beat the&#xD;
proprietary providers&amp;rsquo; inaccurate and out-of-date maps&#xD;
for the quickly changing Tehran which is full of oneway&#xD;
streets and dead end alleys, and release the first free maps&#xD;
of the huge city where we&amp;rsquo;ve been born and brought up.&#xD;
</description>
    </item>
    <item>
      <pubDate>Thu, 8 Mar 2007 15:20:05 GMT</pubDate>
      <title>8 Mar 2007</title>
      <link>http://www.advogato.org/person/roozbeh/diary.html?start=142</link>
      <guid>http://www.advogato.org/person/roozbeh/diary.html?start=142</guid>
      <description>&lt;strong&gt;Rally:&lt;/strong&gt; We will be participating in a &lt;a&#xD;
href="http://en.wikipedia.org/wiki/TSD_rally"&gt;TSD Rally&lt;/a&gt;&#xD;
tomorrow. So if you live in Tehran, watch for the numbered&#xD;
cars, which may pass your street, it&amp;rsquo;s quite fun!&#xD;
</description>
    </item>
  </channel>
</rss>
