<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>davinci’s notebook</title>
	<atom:link href="http://stargrads.net/blogs/davinci/feed/" rel="self" type="application/rss+xml" />
	<link>http://stargrads.net/blogs/davinci</link>
	<description>everything is an experiment</description>
	<lastBuildDate>Mon, 26 Jul 2010 04:58:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>fa</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Revenge as a Motivation for Abusive Parents</title>
		<link>http://stargrads.net/blogs/davinci/2010/06/revenge-as-a-motivation-for-abusive-parents/</link>
		<comments>http://stargrads.net/blogs/davinci/2010/06/revenge-as-a-motivation-for-abusive-parents/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 03:30:43 +0000</pubDate>
		<dc:creator>davinci</dc:creator>
				<category><![CDATA[autobiography]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[Alice Miller]]></category>
		<category><![CDATA[authoritarian parenting]]></category>
		<category><![CDATA[authoritarian parents]]></category>
		<category><![CDATA[child abuse]]></category>
		<category><![CDATA[revenge]]></category>

		<guid isPermaLink="false">http://stargrads.net/blogs/davinci/?p=2687</guid>
		<description><![CDATA[
As I have alluded to in my previous post, I&#8217;m current reading Alice Miller&#8217;s For Your Own Good[1].  
(Coincidentally, she passed away just a few days before I wrote that post, although I didn&#8217;t know about this at the time.)
I&#8217;m only about half way through the book, but one particular idea really struck me, [...]
]]></description>
			<content:encoded><![CDATA[<p>As I have alluded to in <a href="http://stargrads.net/blogs/davinci/2010/04/alice-miller-and-children-of-trauma/">my previous post</a>, I&#8217;m current reading <a href="http://www.alice-miller.com/">Alice Miller</a>&#8217;s <em>For Your Own Good</em><sup><a class='footnote' id='note-2687-1' href='#footnote-2687-miller2002'>[1]</a></sup>.  </p>
<p>(Coincidentally, she passed away just a few days before I wrote that post, although I didn&#8217;t know about this at the time.)</p>
<p>I&#8217;m only about half way through the book, but one particular idea really struck me, and I wanted to write something about it.  It&#8217;s so obvious in retrospect, and explains so much about the behaviour of my biological parents towards me throughout my life, that I&#8217;m shocked that I hadn&#8217;t thought of it earlier myself<span id="more-2687"></span>.  And that is that abusive parents are actually exacting revenge through their children for the pain and humiliation that they feel or have felt themselves.</p>
<p>This is the only possible explanation for their self-contradictory behaviour of simultaneously punishing me for my academic interests and activities while loudly claiming credit for my academic accomplishments.  The same people who screamed at me or beat me for learning about a subject during a school term would suddenly turn around and brag to their relatives about what high marks I achieved in the same subject at the end of the term.  I had never understood how they could be so blatantly hypocritical, or so oblivious to the fact that their actions were completely counterproductive to their ostensible goal.</p>
<p>Like many children raised by abusive authoritarian Asian parents, I had been operating under the assumption that my biological parents&#8217; goal was for me to be academically successful, and that only their methods had been misguided.  This was why it was so difficult for me to cope with the fact that the higher I reached academically, the more infuriated my biological parents became and the more harshly they punished me for my success.  They continually disparaged my research as &#8220;worthless&#8221;, criticised me for going to scientific conferences, <a href="http://stargrads.net/blogs/davinci/2009/05/my-depression-in-waterloo-part-5-feeling-unworthy/">spoke dismissively of the research institutes where I worked</a>, and <a href="http://stargrads.net/blogs/davinci/2009/05/my-depression-in-waterloo-part-1-the-first-term/">insulted</a> my <a href="http://stargrads.net/blogs/davinci/2009/06/my-depression-in-waterloo-part-12-the-aftermath/">colleagues</a> who are some of the most respected scientists in the world.  This is simply not the behaviour you would expect of people who want their child to do well academically.</p>
<p>But it <em>is</em> the behaviour of people who are extremely envious of those who are academically successful.  When I realised this, their behaviour no longer seemed contradictory.  Jealousy explains how they can simultaneously brag about my achievements to others while dismissing my interests and my research as &#8220;worthless&#8221;, disparaging my colleagues as nobodies, and punishing me for doing the very things that I had to do to be successful.  </p>
<p>My biological parents must have been very poor students while they were growing up, and never fulfilled the expectations that <em>their</em> (authoritarian Asian) parents had of them.  They would have grown up habitually dismissing and putting down the achievements of others in a case of &#8220;sour grapes&#8221;, while coveting those same achievements.  They were probably continually compared by their parents to people who were much better students than they were, and felt humiliated by the comparison, but could do nothing about it at the time.</p>
<p>I was very fortunate to have been separated from my biological parents for a period of several years as an adolescent.  During that time, due to the encouragement of my teachers, I excelled in school and, ironically, became the kid that all the other Chinese parents pointed to as an example for their children.  One would think that my biological parents would have been pleased by this.  Instead, my academic excellence enraged them, and as soon as they rejoined me, they started to do everything that they could to prevent me from continuing to be academically successful.  Whereas I had gone to the library and to the houses of classmates freely by myself in their absence, they insisted on regulating when I could go to the library, what books I could read, and whom I could work on school projects with.  They insisted that I maintained my high grades and even took credit for them while doing everything they could to punish me for earning them in the first place.  </p>
<p>When I was in high school, <a href="http://stargrads.net/blogs/davinci/2009/04/the-causes-of-my-depression-part-4-the-mentorship-program/">I visited the university library and did research with a university professor</a>.  Albert Kwok-Wai Yeung 「楊國偉」 first dismissed my research as a &#8220;waste of time&#8221;, and when that didn&#8217;t dissuade me, <a href="http://stargrads.net/blogs/davinci/2009/05/my-depression-in-waterloo-part-7-my-mothers-selfishness-re-visited/">he forbid me from going to the university library</a>.  This was, of course, extremely damaging when I later actually entered university, and had to spend a lot of time at the library just like every other student, and an environment that I used to enjoy became very stressful instead.  I had never understood before why someone would punish his son for being studious (and especially an authoritarian Asian parent, who is supposed to desire this kind of thing), but the idea that he is exacting revenge through me &#8212; on his peers who had been better students than he was, who perhaps had higher marks or enjoyed their studies more than he did, or had opportunities that he never had &#8212; makes perfect sense to me. </p>
<p>Jealousy also explains <a href="http://stargrads.net/blogs/davinci/2009/04/the-causes-of-my-depression-part-5-the-stephen-hawking-incident/">the Stephen Hawking incident</a>, which I have written about earlier.  Albert Kwok-Wai Yeung&#8217;s reaction to my description of Hawking as &#8220;<em>really</em> famous&#8221; &#8212; he turned red in the face and screamed, &#8220;<em>He</em> may have heard of <em>me</em>.  But <em>I</em> have never heard of <em>him</em>.&#8221; &#8212; is absurdly over-the-top in its ridiculousness, but may be explicable as the result of a lifetime of pent-up frustration over being negatively compared to other people by his parents.</p>
<p>Albert Kwok-Wai Yeung used to tell me a story as a child, the significance of which I had not realised until now.  In the story, two people are arguing.  Finally, one of them says, &#8220;You shut up.  I have a Ph.D.&#8221;  Those were the exact words that Albert Kwok-Wai Yeung used, and he always said them with emphasis whenever he told the story, followed by a chuckle.  That, apparently, ended the argument.  Even as a child, I had always thought that the story was stupid, because the guy didn&#8217;t even say what field his Ph.D. was in, so we don&#8217;t know if it&#8217;s even relevant to the argument.  And in any case, a person with a Ph.D. <a href="http://en.wikipedia.org/wiki/Argument_from_authority">can still be occasionally wrong even in his area of expertise</a>.  But apparently, in Albert Kwok-Wai Yeung&#8217;s mind, having a Ph.D. trumps any argument.  (And, unsurprisingly, he has one.)</p>
<p>The story perhaps helps to explain why he expected me to get a Ph.D. while he attacked my scientific interests as &#8220;worthless&#8221; and threatened me for associating with my scientific colleagues and would-be colleagues.  To him, a Ph.D. is just a means of getting revenge on people whose intellect made him feel inferior, which would include my colleagues.  Therefore, I was both expected to get one and to avoid such people while doing so, a situation that was impossible.</p>
<p>The revenge motive also explains the extreme selfishness of Agnes Yuk-Lan Yu 「余玉蘭」.  Whenever I was in a position to teach or to help someone learn something, <a href="http://stargrads.net/blogs/davinci/2009/04/the-causes-of-my-depression-part-7-my-mothers-selfishness/">she would <em>insist</em> that I withhold some information</a>.  Her insistence on this point <a href="http://stargrads.net/blogs/davinci/2009/05/my-depression-in-waterloo-part-7-my-mothers-selfishness-re-visited/">made it impossible for me to perform my duties as a teaching assistant</a> in graduate school, which forced me to turn down my teaching assistantship (and the funding that came with it), and eventually led to my dropping out of school.  But no matter how I tried to explain to her that it wasn&#8217;t right for me to withhold information from my students when I&#8217;m teaching, she insisted that I had to do it.  She simply wasn&#8217;t rational about it.  After reading Alice Miller&#8217;s theory about the revenge compulsion in parents, I think it must have been the case that when Agnes Yuk-Lan Yu was a student and had sought help from her peers, they had withheld information from her.  But because she was a poor student and nobody came to her for help in turn, she did not have the power to withhold information from others herself, and therefore was always covetous of this power.  Subsequently, whenever I got into a position where I was able to teach or to help others, she saw it as an opportunity to exercise through me the power to withhold information that she never had.</p>
<p>I think many children of abusive authoritarian Asian parents assume, incorrectly, that their parents are motivated by wanting them to do well in school, rather than by revenge against or jealousy of their peers who had done better academically than they had.  This is a dangerous assumption, because if the child somehow manages to do well in school in spite of his or her authoritarian parents, he or she will expect them to be pleased and will be taken completely by surprise by the negative reaction that actually follows (as I was).  And this can have serious consequences for the psychological development of the child.</p>
<p>&#8211; davinci 12060</p>




	<a rel="nofollow"  href="http://stargrads.net/blogs/davinci/feed/" title="RSS"><img src="http://stargrads.net/common/images/handycons/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=Revenge%20as%20a%20Motivation%20for%20Abusive%20Parents&amp;body=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F06%2Frevenge-as-a-motivation-for-abusive-parents%2F" title="email"><img src="http://stargrads.net/common/images/handycons/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F06%2Frevenge-as-a-motivation-for-abusive-parents%2F&amp;t=Revenge%20as%20a%20Motivation%20for%20Abusive%20Parents" title="Facebook"><img src="http://stargrads.net/common/images/handycons/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=Revenge%20as%20a%20Motivation%20for%20Abusive%20Parents%20-%20http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F06%2Frevenge-as-a-motivation-for-abusive-parents%2F" title="Twitter"><img src="http://stargrads.net/common/images/handycons/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=Revenge%20as%20a%20Motivation%20for%20Abusive%20Parents&amp;link=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F06%2Frevenge-as-a-motivation-for-abusive-parents%2F" title="FriendFeed"><img src="http://stargrads.net/common/images/handycons/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F06%2Frevenge-as-a-motivation-for-abusive-parents%2F&amp;title=Revenge%20as%20a%20Motivation%20for%20Abusive%20Parents&amp;notes=As%20I%20have%20alluded%20to%20in%20%5Bhttp%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F04%2Falice-miller-and-children-of-trauma%2F%20my%20previous%20post%5D%2C%20I%27m%20current%20reading%20%5Bhttp%3A%2F%2Fwww.alice-miller.com%2F%20Alice%20Miller%5D%27s%20%27%27For%20Your%20Own%20Good%27%27.%20%20%0D%0A%0D%0A%28Coincidentally%2C%20she%20passed%20away" title="del.icio.us"><img src="http://stargrads.net/common/images/handycons/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F06%2Frevenge-as-a-motivation-for-abusive-parents%2F&amp;title=Revenge%20as%20a%20Motivation%20for%20Abusive%20Parents&amp;bodytext=As%20I%20have%20alluded%20to%20in%20%5Bhttp%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F04%2Falice-miller-and-children-of-trauma%2F%20my%20previous%20post%5D%2C%20I%27m%20current%20reading%20%5Bhttp%3A%2F%2Fwww.alice-miller.com%2F%20Alice%20Miller%5D%27s%20%27%27For%20Your%20Own%20Good%27%27.%20%20%0D%0A%0D%0A%28Coincidentally%2C%20she%20passed%20away" title="Digg"><img src="http://stargrads.net/common/images/handycons/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F06%2Frevenge-as-a-motivation-for-abusive-parents%2F&amp;title=Revenge%20as%20a%20Motivation%20for%20Abusive%20Parents&amp;annotation=As%20I%20have%20alluded%20to%20in%20%5Bhttp%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F04%2Falice-miller-and-children-of-trauma%2F%20my%20previous%20post%5D%2C%20I%27m%20current%20reading%20%5Bhttp%3A%2F%2Fwww.alice-miller.com%2F%20Alice%20Miller%5D%27s%20%27%27For%20Your%20Own%20Good%27%27.%20%20%0D%0A%0D%0A%28Coincidentally%2C%20she%20passed%20away" title="Google Bookmarks"><img src="http://stargrads.net/common/images/handycons/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://bookmarks.yahoo.com/toolbar/savebm?u=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F06%2Frevenge-as-a-motivation-for-abusive-parents%2F&amp;t=Revenge%20as%20a%20Motivation%20for%20Abusive%20Parents&opener=bm&amp;ei=UTF-8&amp;d=As%20I%20have%20alluded%20to%20in%20%5Bhttp%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F04%2Falice-miller-and-children-of-trauma%2F%20my%20previous%20post%5D%2C%20I%27m%20current%20reading%20%5Bhttp%3A%2F%2Fwww.alice-miller.com%2F%20Alice%20Miller%5D%27s%20%27%27For%20Your%20Own%20Good%27%27.%20%20%0D%0A%0D%0A%28Coincidentally%2C%20she%20passed%20away" title="Yahoo! Bookmarks"><img src="http://stargrads.net/common/images/handycons/yahoomyweb.png" title="Yahoo! Bookmarks" alt="Yahoo! Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F06%2Frevenge-as-a-motivation-for-abusive-parents%2F&amp;title=Revenge%20as%20a%20Motivation%20for%20Abusive%20Parents" title="StumbleUpon"><img src="http://stargrads.net/common/images/handycons/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F06%2Frevenge-as-a-motivation-for-abusive-parents%2F" title="Technorati"><img src="http://stargrads.net/common/images/handycons/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F06%2Frevenge-as-a-motivation-for-abusive-parents%2F&amp;title=Revenge%20as%20a%20Motivation%20for%20Abusive%20Parents" title="Reddit"><img src="http://stargrads.net/common/images/handycons/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>


<br/><br/><img src="http://stargrads.net/blogs/davinci/?ak_action=api_record_view&id=2687&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://stargrads.net/blogs/davinci/2010/03/albert-kwok-wai-yeung-and-agnes-yuk-lan-yu-are-child-abusers/' rel='bookmark' title='Permanent Link: Albert Kwok-Wai Yeung 「楊國偉」 and Agnes Yuk-Lan Yu 「余玉蘭」 are child abusers'>Albert Kwok-Wai Yeung 「楊國偉」 and Agnes Yuk-Lan Yu 「余玉蘭」 are child abusers</a></li>
<li><a href='http://stargrads.net/blogs/davinci/2009/05/the-causes-of-my-depression-part-18-my-parents-blamed-me-for-911/' rel='bookmark' title='Permanent Link: The causes of my depression, part 18: my parents blamed me for 9/11'>The causes of my depression, part 18: my parents blamed me for 9/11</a></li>
<li><a href='http://stargrads.net/blogs/davinci/2009/05/my-depression-in-waterloo-part-2-role-reversal-and-sacrifice/' rel='bookmark' title='Permanent Link: My depression in Waterloo, part 2: role reversal and sacrifice'>My depression in Waterloo, part 2: role reversal and sacrifice</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://stargrads.net/blogs/davinci/2010/06/revenge-as-a-motivation-for-abusive-parents/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Alice Miller and Children of Trauma</title>
		<link>http://stargrads.net/blogs/davinci/2010/04/alice-miller-and-children-of-trauma/</link>
		<comments>http://stargrads.net/blogs/davinci/2010/04/alice-miller-and-children-of-trauma/#comments</comments>
		<pubDate>Sun, 18 Apr 2010 04:13:47 +0000</pubDate>
		<dc:creator>davinci</dc:creator>
				<category><![CDATA[social issues]]></category>
		<category><![CDATA[abused children]]></category>
		<category><![CDATA[Alice Miller]]></category>
		<category><![CDATA[child abuse]]></category>
		<category><![CDATA[children of trauma]]></category>
		<category><![CDATA[gifted child]]></category>
		<category><![CDATA[gifted children]]></category>
		<category><![CDATA[Jane Middleton-Moz]]></category>

		<guid isPermaLink="false">http://stargrads.net/blogs/davinci/?p=2680</guid>
		<description><![CDATA[
I'm reading two books on child abuse and mistreatment of children.
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently reading several books by <a href="http://www.alice-miller.com/">Alice Miller</a>, an author and researcher whose focus is on child abuse and mistreatment.</p>
<p>When I was growing up, I&#8217;ve always felt that my parents were not like other people&#8217;s parents.  I wish I had known about and had access to books like those written by Miller, who relate the stories of people like myself.  I guess they must have always been available at the library, but I had never thought to look for such books until recent years.  </p>
<p>It&#8217;s a tremendous relief to have someone explain what I have gone through<span id="more-2680"></span>, and to come to an understanding of many of the hidden reasons behind why I was treated in the way that I was by my parents.  I have just finished reading <em>The Drama of the Gifted Child</em><sup><a class='footnote' id='note-2680-1' href='#footnote-2680-miller2007'>[1]</a></sup>.  Miller uses &#8220;gifted&#8221; here not with the usual meaning of being intellectually precocious, but to denote children who are especially emotionally sensitive.</p>
<p>Before embarking on the next book by Miller, I started <em>Children of Trauma</em><sup><a class='footnote' id='note-2680-2' href='#footnote-2680-middeltonmoz1989'>[2]</a></sup> by Jane Middleton-Moz.  This book was actually recommended to me by my counsellor a while back, but I haven&#8217;t looked at it until now.  Like Miller, Middleton-Moz writes about children who have had traumatic childhoods.  Her book follows a similar format in that it alternates between case examples of children who have experienced trauma (or adults who have experienced trauma as children), and analyses and explanations of the examples.</p>
<p>When I have the time, I&#8217;ll post some excerpts along with parallels from my own childhood and upbringing.  </p>
<p>&#8211; davinci 11996</p>




	<a rel="nofollow"  href="http://stargrads.net/blogs/davinci/feed/" title="RSS"><img src="http://stargrads.net/common/images/handycons/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=Alice%20Miller%20and%20Children%20of%20Trauma&amp;body=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F04%2Falice-miller-and-children-of-trauma%2F" title="email"><img src="http://stargrads.net/common/images/handycons/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F04%2Falice-miller-and-children-of-trauma%2F&amp;t=Alice%20Miller%20and%20Children%20of%20Trauma" title="Facebook"><img src="http://stargrads.net/common/images/handycons/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=Alice%20Miller%20and%20Children%20of%20Trauma%20-%20http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F04%2Falice-miller-and-children-of-trauma%2F" title="Twitter"><img src="http://stargrads.net/common/images/handycons/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=Alice%20Miller%20and%20Children%20of%20Trauma&amp;link=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F04%2Falice-miller-and-children-of-trauma%2F" title="FriendFeed"><img src="http://stargrads.net/common/images/handycons/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F04%2Falice-miller-and-children-of-trauma%2F&amp;title=Alice%20Miller%20and%20Children%20of%20Trauma&amp;notes=I%27m%20reading%20two%20books%20on%20child%20abuse%20and%20mistreatment%20of%20children." title="del.icio.us"><img src="http://stargrads.net/common/images/handycons/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F04%2Falice-miller-and-children-of-trauma%2F&amp;title=Alice%20Miller%20and%20Children%20of%20Trauma&amp;bodytext=I%27m%20reading%20two%20books%20on%20child%20abuse%20and%20mistreatment%20of%20children." title="Digg"><img src="http://stargrads.net/common/images/handycons/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F04%2Falice-miller-and-children-of-trauma%2F&amp;title=Alice%20Miller%20and%20Children%20of%20Trauma&amp;annotation=I%27m%20reading%20two%20books%20on%20child%20abuse%20and%20mistreatment%20of%20children." title="Google Bookmarks"><img src="http://stargrads.net/common/images/handycons/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://bookmarks.yahoo.com/toolbar/savebm?u=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F04%2Falice-miller-and-children-of-trauma%2F&amp;t=Alice%20Miller%20and%20Children%20of%20Trauma&opener=bm&amp;ei=UTF-8&amp;d=I%27m%20reading%20two%20books%20on%20child%20abuse%20and%20mistreatment%20of%20children." title="Yahoo! Bookmarks"><img src="http://stargrads.net/common/images/handycons/yahoomyweb.png" title="Yahoo! Bookmarks" alt="Yahoo! Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F04%2Falice-miller-and-children-of-trauma%2F&amp;title=Alice%20Miller%20and%20Children%20of%20Trauma" title="StumbleUpon"><img src="http://stargrads.net/common/images/handycons/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F04%2Falice-miller-and-children-of-trauma%2F" title="Technorati"><img src="http://stargrads.net/common/images/handycons/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F04%2Falice-miller-and-children-of-trauma%2F&amp;title=Alice%20Miller%20and%20Children%20of%20Trauma" title="Reddit"><img src="http://stargrads.net/common/images/handycons/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>


<br/><br/><img src="http://stargrads.net/blogs/davinci/?ak_action=api_record_view&id=2680&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://stargrads.net/blogs/davinci/2008/11/authoritarian-parenting-and-its-harmful-effects-on-gifted-children/' rel='bookmark' title='Permanent Link: Authoritarian parenting and its harmful effects on gifted children'>Authoritarian parenting and its harmful effects on gifted children</a></li>
<li><a href='http://stargrads.net/blogs/davinci/2009/05/miscellaneous-articles-about-raising-gifted-children-from-scientific-american/' rel='bookmark' title='Permanent Link: Miscellaneous articles about raising gifted children, from Scientific American'>Miscellaneous articles about raising gifted children, from Scientific American</a></li>
<li><a href='http://stargrads.net/blogs/davinci/2008/11/why-and-for-whom-am-i-writing-this/' rel='bookmark' title='Permanent Link: Why and for whom am I writing this?'>Why and for whom am I writing this?</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://stargrads.net/blogs/davinci/2010/04/alice-miller-and-children-of-trauma/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Albert Kwok-Wai Yeung 「楊國偉」 and Agnes Yuk-Lan Yu 「余玉蘭」 are child abusers</title>
		<link>http://stargrads.net/blogs/davinci/2010/03/albert-kwok-wai-yeung-and-agnes-yuk-lan-yu-are-child-abusers/</link>
		<comments>http://stargrads.net/blogs/davinci/2010/03/albert-kwok-wai-yeung-and-agnes-yuk-lan-yu-are-child-abusers/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 04:11:48 +0000</pubDate>
		<dc:creator>davinci</dc:creator>
				<category><![CDATA[personal]]></category>
		<category><![CDATA[social issues]]></category>
		<category><![CDATA[Agnes Yuk-Lan Yu]]></category>
		<category><![CDATA[Albert Kwok-Wai Yeung]]></category>
		<category><![CDATA[child abuse]]></category>
		<category><![CDATA[child abusers]]></category>
		<category><![CDATA[余玉蘭]]></category>
		<category><![CDATA[楊國偉]]></category>

		<guid isPermaLink="false">http://stargrads.net/blogs/davinci/?p=2483</guid>
		<description><![CDATA[
The title says it all.
]]></description>
			<content:encoded><![CDATA[<p><!--noadsense-->This post will not mean very much to anyone other than myself.</p>
<p><strong>Albert Kwok-Wai Yeung 「楊國偉」 and Agnes Yuk-Lan Yu 「余玉蘭」 are child abusers.</strong>  I just wanted to post this fact on the Internet so that it can be recorded for posterity<span id="more-2483"></span>.</p>
<p><a target='_blank' title='Child abusers Albert Kwok-Wai Yeung 「楊國偉」 and Agnes Yuk-Lan Yu 「余玉蘭」.' href='http://img197.imageshack.us/i/childabusersp.jpg/'><img src='http://img197.imageshack.us/img197/3269/childabusersp.jpg'></a></p>
<p>The nature of child abuse is such that it rarely occurs in public.  The recipients of the abuse are left to deal with its effects while the perpetrators typically face no ill consequences.</p>
<p>Actually, child abuse harms many more people than just the immediate recipients of the abuse.  The fact that Albert Kwok-Wai Yeung had been beating and threatening me since I was a child for studying the topics which would form the background of my intended Ph.D. did not merely cause me to drop out of the Ph.D. program.  It also wasted the efforts of everyone &#8212; teachers, professors, fellow graduate students, and colleagues &#8212; who helped me, who worked with me or wanted to work with me, or who otherwise poured their energies and resources into advancing science and attracting young people into their fields.  I could not attend certain scientific conferences because Albert Kwok-Wai Yeung had forbid me from or threatened me for doing so, and at many scientific meetings I could not contribute to the best of my abilities because of the need to hide my activities from him.  His actions meant that I could return very little to the scientific community for the resources that I consumed, which made me feel very guilty about being in my field, which in turn made it impossible for me to continue with my studies.</p>
<p>As another example, I&#8217;ve already written <a href="http://stargrads.net/blogs/davinci/2009/05/my-depression-in-waterloo-part-7-my-mothers-selfishness-re-visited/">previously</a> about how Agnes Yuk-Lan Yu would not stop criticising me, after I won a <abbr title="teaching assistant">TA</abbr> award, for <em>not</em> withholding information from my students &#8212; in other words, for <em>not</em> doing my job <em>poorly</em>.  Presumably, the university rewards graduate students who make an effort at teaching (even if the reward is only a little bit of recognition) to encourage the development of good lecturers.  Because of Agnes Yuk-Lan Yu&#8217;s behaviour, I stopped being a teaching assistant and never applied to lecture any courses.  Again, this wasted the efforts of many people at the university and harmed many people besides myself.</p>
<p>There is nothing that I can do to turn back the clock and undo the damage that Albert Kwok-Wai Yeung and Agnes Yuk-Lan Yu have done not just to my own scientific career, but to the broader scientific community &#8212; damage which they perpetrated through me.  But I want their names to be remembered in history for the child abusers and enemies of science that they are, so that people can learn through my mistakes how better to deal with others like them in the future.</p>
<p>&#8211; davinci 11954</p>




	<a rel="nofollow"  href="http://stargrads.net/blogs/davinci/feed/" title="RSS"><img src="http://stargrads.net/common/images/handycons/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=Albert%20Kwok-Wai%20Yeung%20%E3%80%8C%E6%A5%8A%E5%9C%8B%E5%81%89%E3%80%8D%20and%20Agnes%20Yuk-Lan%20Yu%20%E3%80%8C%E4%BD%99%E7%8E%89%E8%98%AD%E3%80%8D%20are%20child%20abusers&amp;body=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F03%2Falbert-kwok-wai-yeung-and-agnes-yuk-lan-yu-are-child-abusers%2F" title="email"><img src="http://stargrads.net/common/images/handycons/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F03%2Falbert-kwok-wai-yeung-and-agnes-yuk-lan-yu-are-child-abusers%2F&amp;t=Albert%20Kwok-Wai%20Yeung%20%E3%80%8C%E6%A5%8A%E5%9C%8B%E5%81%89%E3%80%8D%20and%20Agnes%20Yuk-Lan%20Yu%20%E3%80%8C%E4%BD%99%E7%8E%89%E8%98%AD%E3%80%8D%20are%20child%20abusers" title="Facebook"><img src="http://stargrads.net/common/images/handycons/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=Albert%20Kwok-Wai%20Yeung%20%E3%80%8C%E6%A5%8A%E5%9C%8B%E5%81%89%E3%80%8D%20and%20Agnes%20Yuk-Lan%20Yu%20%E3%80%8C%E4%BD%99%E7%8E%89%E8%98%AD%E3%80%8D%20are%20child%20abusers%20-%20http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F03%2Falbert-kwok-wai-yeung-and-agnes-yuk-lan-yu-are-child-abusers%2F" title="Twitter"><img src="http://stargrads.net/common/images/handycons/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=Albert%20Kwok-Wai%20Yeung%20%E3%80%8C%E6%A5%8A%E5%9C%8B%E5%81%89%E3%80%8D%20and%20Agnes%20Yuk-Lan%20Yu%20%E3%80%8C%E4%BD%99%E7%8E%89%E8%98%AD%E3%80%8D%20are%20child%20abusers&amp;link=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F03%2Falbert-kwok-wai-yeung-and-agnes-yuk-lan-yu-are-child-abusers%2F" title="FriendFeed"><img src="http://stargrads.net/common/images/handycons/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F03%2Falbert-kwok-wai-yeung-and-agnes-yuk-lan-yu-are-child-abusers%2F&amp;title=Albert%20Kwok-Wai%20Yeung%20%E3%80%8C%E6%A5%8A%E5%9C%8B%E5%81%89%E3%80%8D%20and%20Agnes%20Yuk-Lan%20Yu%20%E3%80%8C%E4%BD%99%E7%8E%89%E8%98%AD%E3%80%8D%20are%20child%20abusers&amp;notes=The%20title%20says%20it%20all." title="del.icio.us"><img src="http://stargrads.net/common/images/handycons/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F03%2Falbert-kwok-wai-yeung-and-agnes-yuk-lan-yu-are-child-abusers%2F&amp;title=Albert%20Kwok-Wai%20Yeung%20%E3%80%8C%E6%A5%8A%E5%9C%8B%E5%81%89%E3%80%8D%20and%20Agnes%20Yuk-Lan%20Yu%20%E3%80%8C%E4%BD%99%E7%8E%89%E8%98%AD%E3%80%8D%20are%20child%20abusers&amp;bodytext=The%20title%20says%20it%20all." title="Digg"><img src="http://stargrads.net/common/images/handycons/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F03%2Falbert-kwok-wai-yeung-and-agnes-yuk-lan-yu-are-child-abusers%2F&amp;title=Albert%20Kwok-Wai%20Yeung%20%E3%80%8C%E6%A5%8A%E5%9C%8B%E5%81%89%E3%80%8D%20and%20Agnes%20Yuk-Lan%20Yu%20%E3%80%8C%E4%BD%99%E7%8E%89%E8%98%AD%E3%80%8D%20are%20child%20abusers&amp;annotation=The%20title%20says%20it%20all." title="Google Bookmarks"><img src="http://stargrads.net/common/images/handycons/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://bookmarks.yahoo.com/toolbar/savebm?u=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F03%2Falbert-kwok-wai-yeung-and-agnes-yuk-lan-yu-are-child-abusers%2F&amp;t=Albert%20Kwok-Wai%20Yeung%20%E3%80%8C%E6%A5%8A%E5%9C%8B%E5%81%89%E3%80%8D%20and%20Agnes%20Yuk-Lan%20Yu%20%E3%80%8C%E4%BD%99%E7%8E%89%E8%98%AD%E3%80%8D%20are%20child%20abusers&opener=bm&amp;ei=UTF-8&amp;d=The%20title%20says%20it%20all." title="Yahoo! Bookmarks"><img src="http://stargrads.net/common/images/handycons/yahoomyweb.png" title="Yahoo! Bookmarks" alt="Yahoo! Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F03%2Falbert-kwok-wai-yeung-and-agnes-yuk-lan-yu-are-child-abusers%2F&amp;title=Albert%20Kwok-Wai%20Yeung%20%E3%80%8C%E6%A5%8A%E5%9C%8B%E5%81%89%E3%80%8D%20and%20Agnes%20Yuk-Lan%20Yu%20%E3%80%8C%E4%BD%99%E7%8E%89%E8%98%AD%E3%80%8D%20are%20child%20abusers" title="StumbleUpon"><img src="http://stargrads.net/common/images/handycons/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F03%2Falbert-kwok-wai-yeung-and-agnes-yuk-lan-yu-are-child-abusers%2F" title="Technorati"><img src="http://stargrads.net/common/images/handycons/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2010%2F03%2Falbert-kwok-wai-yeung-and-agnes-yuk-lan-yu-are-child-abusers%2F&amp;title=Albert%20Kwok-Wai%20Yeung%20%E3%80%8C%E6%A5%8A%E5%9C%8B%E5%81%89%E3%80%8D%20and%20Agnes%20Yuk-Lan%20Yu%20%E3%80%8C%E4%BD%99%E7%8E%89%E8%98%AD%E3%80%8D%20are%20child%20abusers" title="Reddit"><img src="http://stargrads.net/common/images/handycons/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>


<br/><br/><img src="http://stargrads.net/blogs/davinci/?ak_action=api_record_view&id=2483&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://stargrads.net/blogs/davinci/2010/06/revenge-as-a-motivation-for-abusive-parents/' rel='bookmark' title='Permanent Link: Revenge as a Motivation for Abusive Parents'>Revenge as a Motivation for Abusive Parents</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://stargrads.net/blogs/davinci/2010/03/albert-kwok-wai-yeung-and-agnes-yuk-lan-yu-are-child-abusers/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>The Physics of Star Trek by Lawrence M. Krauss</title>
		<link>http://stargrads.net/blogs/davinci/2009/12/the-physics-of-star-trek-by-lawrence-m-krauss/</link>
		<comments>http://stargrads.net/blogs/davinci/2009/12/the-physics-of-star-trek-by-lawrence-m-krauss/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 15:22:57 +0000</pubDate>
		<dc:creator>davinci</dc:creator>
				<category><![CDATA[a life in books]]></category>
		<category><![CDATA[Lawrence M. Krauss]]></category>
		<category><![CDATA[physics]]></category>
		<category><![CDATA[plot devices]]></category>
		<category><![CDATA[science fiction]]></category>
		<category><![CDATA[space travel]]></category>
		<category><![CDATA[Star Trek]]></category>
		<category><![CDATA[The Physics of Star Trek]]></category>

		<guid isPermaLink="false">http://stargrads.net/blogs/davinci/?p=1501</guid>
		<description><![CDATA[
A popular book on the physics behind Star Trek's plot devices.
]]></description>
			<content:encoded><![CDATA[<p><!--noadsense-->The <a href="http://stargrads.net/blogs/davinci/2009/11/perimeter-scholars-international-masters-program-in-theoretical-physics/">previous post</a> advertising the <a href="http://perimeterinstitute.ca/">Perimeter Institute</a>&#8217;s <a href="http://www.perimeterscholars.org/">Master&#8217;s program</a> reminded me of this book, which continues my series &ldquo;<a href="http://stargrads.net/blogs/davinci/category/personal/a-life-in-books/">a life in books</a>&rdquo;.</p>
<p><a href="http://img246.imageshack.us/img246/4053/p7230300rotated.jpg" target="_blank"><img src="http://img246.imageshack.us/img246/4053/p7230300rotated.th.jpg" border="0" /></a></p>
<p><a href="http://www.amazon.ca/gp/product/0465002048?ie=UTF8&amp;tag=davincisnoteb-20&amp;linkCode=as2&amp;camp=15121&amp;creative=330641&amp;creativeASIN=0465002048"><i>The Physics of Star Trek</i></a><img src="http://www.assoc-amazon.ca/e/ir?t=davincisnoteb-20&amp;l=as2&amp;o=15&amp;a=0465002048" width="1" height="1" border="0" alt="" style="border:none !important;margin:0px !important" /> by <a href="http://en.wikipedia.org/wiki/Lawrence_M._Krauss">Lawrence M. Krauss</a> is geared more towards Star Trek fans than towards physicists<span id="more-1501"></span>.  I remember thinking that it needed some equations, although I&#8217;m probably not the typical reader of this book.  It has just the right depth to satisfy fans of the series, but not enough detail for anyone who is actually really interested in the (pseudo-)science behind the series&#8217; plot devices.  The take-home message of the book is that traveling to another galaxy is very, <em>very</em> impossible &#8212; at least according to our currently known laws of physics.</p>
<p>&#8211; davinci 11864</p>




	<a rel="nofollow"  href="http://stargrads.net/blogs/davinci/feed/" title="RSS"><img src="http://stargrads.net/common/images/handycons/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=The%20Physics%20of%20Star%20Trek%20by%20Lawrence%20M.%20Krauss&amp;body=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F12%2Fthe-physics-of-star-trek-by-lawrence-m-krauss%2F" title="email"><img src="http://stargrads.net/common/images/handycons/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F12%2Fthe-physics-of-star-trek-by-lawrence-m-krauss%2F&amp;t=The%20Physics%20of%20Star%20Trek%20by%20Lawrence%20M.%20Krauss" title="Facebook"><img src="http://stargrads.net/common/images/handycons/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=The%20Physics%20of%20Star%20Trek%20by%20Lawrence%20M.%20Krauss%20-%20http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F12%2Fthe-physics-of-star-trek-by-lawrence-m-krauss%2F" title="Twitter"><img src="http://stargrads.net/common/images/handycons/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=The%20Physics%20of%20Star%20Trek%20by%20Lawrence%20M.%20Krauss&amp;link=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F12%2Fthe-physics-of-star-trek-by-lawrence-m-krauss%2F" title="FriendFeed"><img src="http://stargrads.net/common/images/handycons/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F12%2Fthe-physics-of-star-trek-by-lawrence-m-krauss%2F&amp;title=The%20Physics%20of%20Star%20Trek%20by%20Lawrence%20M.%20Krauss&amp;notes=A%20popular%20book%20on%20the%20physics%20behind%20Star%20Trek%27s%20plot%20devices." title="del.icio.us"><img src="http://stargrads.net/common/images/handycons/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F12%2Fthe-physics-of-star-trek-by-lawrence-m-krauss%2F&amp;title=The%20Physics%20of%20Star%20Trek%20by%20Lawrence%20M.%20Krauss&amp;bodytext=A%20popular%20book%20on%20the%20physics%20behind%20Star%20Trek%27s%20plot%20devices." title="Digg"><img src="http://stargrads.net/common/images/handycons/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F12%2Fthe-physics-of-star-trek-by-lawrence-m-krauss%2F&amp;title=The%20Physics%20of%20Star%20Trek%20by%20Lawrence%20M.%20Krauss&amp;annotation=A%20popular%20book%20on%20the%20physics%20behind%20Star%20Trek%27s%20plot%20devices." title="Google Bookmarks"><img src="http://stargrads.net/common/images/handycons/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://bookmarks.yahoo.com/toolbar/savebm?u=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F12%2Fthe-physics-of-star-trek-by-lawrence-m-krauss%2F&amp;t=The%20Physics%20of%20Star%20Trek%20by%20Lawrence%20M.%20Krauss&opener=bm&amp;ei=UTF-8&amp;d=A%20popular%20book%20on%20the%20physics%20behind%20Star%20Trek%27s%20plot%20devices." title="Yahoo! Bookmarks"><img src="http://stargrads.net/common/images/handycons/yahoomyweb.png" title="Yahoo! Bookmarks" alt="Yahoo! Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F12%2Fthe-physics-of-star-trek-by-lawrence-m-krauss%2F&amp;title=The%20Physics%20of%20Star%20Trek%20by%20Lawrence%20M.%20Krauss" title="StumbleUpon"><img src="http://stargrads.net/common/images/handycons/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F12%2Fthe-physics-of-star-trek-by-lawrence-m-krauss%2F" title="Technorati"><img src="http://stargrads.net/common/images/handycons/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F12%2Fthe-physics-of-star-trek-by-lawrence-m-krauss%2F&amp;title=The%20Physics%20of%20Star%20Trek%20by%20Lawrence%20M.%20Krauss" title="Reddit"><img src="http://stargrads.net/common/images/handycons/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>


<br/><br/><img src="http://stargrads.net/blogs/davinci/?ak_action=api_record_view&id=1501&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://stargrads.net/blogs/davinci/2009/09/theoretical-physics-by-joos-and-freeman/' rel='bookmark' title='Permanent Link: Theoretical Physics by Joos and Freeman'>Theoretical Physics by Joos and Freeman</a></li>
<li><a href='http://stargrads.net/blogs/davinci/2009/11/perimeter-scholars-international-masters-program-in-theoretical-physics/' rel='bookmark' title='Permanent Link: Perimeter Scholars International &#8212; Master&#8217;s program in Theoretical Physics'>Perimeter Scholars International &#8212; Master&#8217;s program in Theoretical Physics</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://stargrads.net/blogs/davinci/2009/12/the-physics-of-star-trek-by-lawrence-m-krauss/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Glyph-shaping poster fail</title>
		<link>http://stargrads.net/blogs/davinci/2009/12/glyph-shaping-poster-fail/</link>
		<comments>http://stargrads.net/blogs/davinci/2009/12/glyph-shaping-poster-fail/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 15:12:48 +0000</pubDate>
		<dc:creator>davinci</dc:creator>
				<category><![CDATA[frivolous nonsense]]></category>
		<category><![CDATA[Arabic]]></category>
		<category><![CDATA[Campus for Christ]]></category>
		<category><![CDATA[fail]]></category>
		<category><![CDATA[glyph-shaping]]></category>
		<category><![CDATA[international relations]]></category>
		<category><![CDATA[University of Waterloo]]></category>

		<guid isPermaLink="false">http://stargrads.net/blogs/davinci/?p=2609</guid>
		<description><![CDATA[
A poster with blatantly wrong Arabic that is plastered all over University of Waterloo campus.
]]></description>
			<content:encoded><![CDATA[<p><!--noadsense--><a href="http://www.facebook.com/photo.php?pid=155494&amp;l=a69773c076&amp;id=100000085740395"><img src="http://photos-f.ak.fbcdn.net/hphotos-ak-snc3/hs042.snc3/12967_105674189445439_100000085740395_155494_5791146_n.jpg" /></a></p>
<p>Reposted from <a href="http://www.facebook.com/dlyongemallo">my Facebook</a>:</p>
<blockquote><p>This is a poster for a Christmas Party hosted by Campus for Christ which is found all over UW campus. The problem with it is that the Arabic writing at the top is wrong. As anyone with even a rudimentary knowledge of the Arabic script knows, the letters should be joined, and they change their shape according to position. Clearly, someone had typed the word &#8220;Christmas&#8221; into a translation program on a computer not equipped to handle Arabic glyph-shaping, and put it on the poster without actually bothering to check it with anyone who can actually read Arabic.</p>
<p>Lesson: If you&#8217;re going to plaster something all over campus in a foreign language, do yourself the favour of getting someone who actually knows the language to translate it for you so you don&#8217;t massively embarrass yourself. I&#8217;m sure there&#8217;s at least one Christian who knows Arabic on UW campus. Seriously.</p></blockquote>
<p>In today&#8217;s world, it&#8217;s very important for computer software to be able to support multiple languages.  You can&#8217;t assume that, just because your software is sold in a predominantly English-language market, your users won&#8217;t try to use it with other languages.</p>
<p>In a <a href="http://stargrads.net/blogs/davinci/2009/11/persian-soft-keyboard-and-applications-for-android/">previous post</a>, I noted the current lack of support for glyph-shaping and other aspects of complex text layout on the Android phone.  I hope that this changes in the near future (and, if I have any say about it, it will).</p>
<p>&#8211; davinci 11859</p>




	<a rel="nofollow"  href="http://stargrads.net/blogs/davinci/feed/" title="RSS"><img src="http://stargrads.net/common/images/handycons/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=Glyph-shaping%20poster%20fail&amp;body=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F12%2Fglyph-shaping-poster-fail%2F" title="email"><img src="http://stargrads.net/common/images/handycons/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F12%2Fglyph-shaping-poster-fail%2F&amp;t=Glyph-shaping%20poster%20fail" title="Facebook"><img src="http://stargrads.net/common/images/handycons/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=Glyph-shaping%20poster%20fail%20-%20http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F12%2Fglyph-shaping-poster-fail%2F" title="Twitter"><img src="http://stargrads.net/common/images/handycons/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=Glyph-shaping%20poster%20fail&amp;link=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F12%2Fglyph-shaping-poster-fail%2F" title="FriendFeed"><img src="http://stargrads.net/common/images/handycons/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F12%2Fglyph-shaping-poster-fail%2F&amp;title=Glyph-shaping%20poster%20fail&amp;notes=A%20poster%20with%20blatantly%20wrong%20Arabic%20that%20is%20plastered%20all%20over%20University%20of%20Waterloo%20campus." title="del.icio.us"><img src="http://stargrads.net/common/images/handycons/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F12%2Fglyph-shaping-poster-fail%2F&amp;title=Glyph-shaping%20poster%20fail&amp;bodytext=A%20poster%20with%20blatantly%20wrong%20Arabic%20that%20is%20plastered%20all%20over%20University%20of%20Waterloo%20campus." title="Digg"><img src="http://stargrads.net/common/images/handycons/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F12%2Fglyph-shaping-poster-fail%2F&amp;title=Glyph-shaping%20poster%20fail&amp;annotation=A%20poster%20with%20blatantly%20wrong%20Arabic%20that%20is%20plastered%20all%20over%20University%20of%20Waterloo%20campus." title="Google Bookmarks"><img src="http://stargrads.net/common/images/handycons/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://bookmarks.yahoo.com/toolbar/savebm?u=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F12%2Fglyph-shaping-poster-fail%2F&amp;t=Glyph-shaping%20poster%20fail&opener=bm&amp;ei=UTF-8&amp;d=A%20poster%20with%20blatantly%20wrong%20Arabic%20that%20is%20plastered%20all%20over%20University%20of%20Waterloo%20campus." title="Yahoo! Bookmarks"><img src="http://stargrads.net/common/images/handycons/yahoomyweb.png" title="Yahoo! Bookmarks" alt="Yahoo! Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F12%2Fglyph-shaping-poster-fail%2F&amp;title=Glyph-shaping%20poster%20fail" title="StumbleUpon"><img src="http://stargrads.net/common/images/handycons/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F12%2Fglyph-shaping-poster-fail%2F" title="Technorati"><img src="http://stargrads.net/common/images/handycons/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F12%2Fglyph-shaping-poster-fail%2F&amp;title=Glyph-shaping%20poster%20fail" title="Reddit"><img src="http://stargrads.net/common/images/handycons/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>


<br/><br/><img src="http://stargrads.net/blogs/davinci/?ak_action=api_record_view&id=2609&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://stargrads.net/blogs/davinci/2009/11/persian-soft-keyboard-and-applications-for-android/' rel='bookmark' title='Permanent Link: Persian Soft Keyboard and Applications for Android'>Persian Soft Keyboard and Applications for Android</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://stargrads.net/blogs/davinci/2009/12/glyph-shaping-poster-fail/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Perimeter Scholars International &#8212; Master&#8217;s program in Theoretical Physics</title>
		<link>http://stargrads.net/blogs/davinci/2009/11/perimeter-scholars-international-masters-program-in-theoretical-physics/</link>
		<comments>http://stargrads.net/blogs/davinci/2009/11/perimeter-scholars-international-masters-program-in-theoretical-physics/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 03:34:06 +0000</pubDate>
		<dc:creator>davinci</dc:creator>
				<category><![CDATA[announcements]]></category>
		<category><![CDATA[computer science]]></category>
		<category><![CDATA[engineering]]></category>
		<category><![CDATA[Master's degree]]></category>
		<category><![CDATA[mathematics]]></category>
		<category><![CDATA[Perimeter Institute]]></category>
		<category><![CDATA[physics]]></category>
		<category><![CDATA[theoretical physics]]></category>
		<category><![CDATA[undergraduate]]></category>
		<category><![CDATA[University of Waterloo]]></category>

		<guid isPermaLink="false">http://stargrads.net/blogs/davinci/?p=2592</guid>
		<description><![CDATA[
I was asked to pass this information along to anyone who might be interested:
Canada&#8217;s Perimeter Institute for Theoretical Physics (PI), in partnership with the University of Waterloo, welcomes applications to the Masters level course, Perimeter Scholars International (PSI). Exceptional students with an undergraduate honours degree in Physics, Math, Engineering or Computer Science are encouraged to [...]
]]></description>
			<content:encoded><![CDATA[<p><!--noadsense-->I was asked to pass this information along to anyone who might be interested:</p>
<blockquote><p>Canada&#8217;s Perimeter Institute for Theoretical Physics (PI), in partnership with the University of Waterloo, welcomes applications to the Masters level course, <a href="http://www.perimeterscholars.org/">Perimeter Scholars International (PSI)</a>. Exceptional students with an undergraduate honours degree in Physics, Math, Engineering or Computer Science are encouraged to apply. Students require a minimum of 3 upper level undergraduate or graduate courses in physics. PSI recruits a diverse group of students and especially encourages applications from qualified women candidates.  <u>The due date for applications to PSI is February 1st, 2010</u>.   Complete details are available at <a href="http://www.perimeterscholars.org">www.perimeterscholars.org</a>.</p></blockquote>
<p>There&#8217;s also a downloadable poster with more information at <a href="http://www.perimeterinstitute.ca/campaign_trackerv2.php?track=6ca86499-6f7a-b418-f340-4b0ecf230273&amp;identifier=b3600a4c-e253-7e9b-1046-4b0f39adf163">this link</a>.</p>
<p>&#8211; davinci 11855</p>




	<a rel="nofollow"  href="http://stargrads.net/blogs/davinci/feed/" title="RSS"><img src="http://stargrads.net/common/images/handycons/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=Perimeter%20Scholars%20International%20--%20Master%27s%20program%20in%20Theoretical%20Physics&amp;body=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fperimeter-scholars-international-masters-program-in-theoretical-physics%2F" title="email"><img src="http://stargrads.net/common/images/handycons/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fperimeter-scholars-international-masters-program-in-theoretical-physics%2F&amp;t=Perimeter%20Scholars%20International%20--%20Master%27s%20program%20in%20Theoretical%20Physics" title="Facebook"><img src="http://stargrads.net/common/images/handycons/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=Perimeter%20Scholars%20International%20--%20Master%27s%20program%20in%20Theoretical%20Physics%20-%20http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fperimeter-scholars-international-masters-program-in-theoretical-physics%2F" title="Twitter"><img src="http://stargrads.net/common/images/handycons/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=Perimeter%20Scholars%20International%20--%20Master%27s%20program%20in%20Theoretical%20Physics&amp;link=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fperimeter-scholars-international-masters-program-in-theoretical-physics%2F" title="FriendFeed"><img src="http://stargrads.net/common/images/handycons/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fperimeter-scholars-international-masters-program-in-theoretical-physics%2F&amp;title=Perimeter%20Scholars%20International%20--%20Master%27s%20program%20in%20Theoretical%20Physics&amp;notes=I%20was%20asked%20to%20pass%20this%20information%20along%20to%20anyone%20who%20might%20be%20interested%3A%0D%0ACanada%27s%20Perimeter%20Institute%20for%20Theoretical%20Physics%20%28PI%29%2C%20in%20partnership%20with%20the%20University%20of%20Waterloo%2C%20welcomes%20applications%20to%20the%20Masters%20level%20course%2C%20%5Bhttp%3A%2F%2Fwww.p" title="del.icio.us"><img src="http://stargrads.net/common/images/handycons/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fperimeter-scholars-international-masters-program-in-theoretical-physics%2F&amp;title=Perimeter%20Scholars%20International%20--%20Master%27s%20program%20in%20Theoretical%20Physics&amp;bodytext=I%20was%20asked%20to%20pass%20this%20information%20along%20to%20anyone%20who%20might%20be%20interested%3A%0D%0ACanada%27s%20Perimeter%20Institute%20for%20Theoretical%20Physics%20%28PI%29%2C%20in%20partnership%20with%20the%20University%20of%20Waterloo%2C%20welcomes%20applications%20to%20the%20Masters%20level%20course%2C%20%5Bhttp%3A%2F%2Fwww.p" title="Digg"><img src="http://stargrads.net/common/images/handycons/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fperimeter-scholars-international-masters-program-in-theoretical-physics%2F&amp;title=Perimeter%20Scholars%20International%20--%20Master%27s%20program%20in%20Theoretical%20Physics&amp;annotation=I%20was%20asked%20to%20pass%20this%20information%20along%20to%20anyone%20who%20might%20be%20interested%3A%0D%0ACanada%27s%20Perimeter%20Institute%20for%20Theoretical%20Physics%20%28PI%29%2C%20in%20partnership%20with%20the%20University%20of%20Waterloo%2C%20welcomes%20applications%20to%20the%20Masters%20level%20course%2C%20%5Bhttp%3A%2F%2Fwww.p" title="Google Bookmarks"><img src="http://stargrads.net/common/images/handycons/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://bookmarks.yahoo.com/toolbar/savebm?u=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fperimeter-scholars-international-masters-program-in-theoretical-physics%2F&amp;t=Perimeter%20Scholars%20International%20--%20Master%27s%20program%20in%20Theoretical%20Physics&opener=bm&amp;ei=UTF-8&amp;d=I%20was%20asked%20to%20pass%20this%20information%20along%20to%20anyone%20who%20might%20be%20interested%3A%0D%0ACanada%27s%20Perimeter%20Institute%20for%20Theoretical%20Physics%20%28PI%29%2C%20in%20partnership%20with%20the%20University%20of%20Waterloo%2C%20welcomes%20applications%20to%20the%20Masters%20level%20course%2C%20%5Bhttp%3A%2F%2Fwww.p" title="Yahoo! Bookmarks"><img src="http://stargrads.net/common/images/handycons/yahoomyweb.png" title="Yahoo! Bookmarks" alt="Yahoo! Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fperimeter-scholars-international-masters-program-in-theoretical-physics%2F&amp;title=Perimeter%20Scholars%20International%20--%20Master%27s%20program%20in%20Theoretical%20Physics" title="StumbleUpon"><img src="http://stargrads.net/common/images/handycons/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fperimeter-scholars-international-masters-program-in-theoretical-physics%2F" title="Technorati"><img src="http://stargrads.net/common/images/handycons/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fperimeter-scholars-international-masters-program-in-theoretical-physics%2F&amp;title=Perimeter%20Scholars%20International%20--%20Master%27s%20program%20in%20Theoretical%20Physics" title="Reddit"><img src="http://stargrads.net/common/images/handycons/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>


<br/><br/><img src="http://stargrads.net/blogs/davinci/?ak_action=api_record_view&id=2592&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://stargrads.net/blogs/davinci/2009/09/theoretical-physics-by-joos-and-freeman/' rel='bookmark' title='Permanent Link: Theoretical Physics by Joos and Freeman'>Theoretical Physics by Joos and Freeman</a></li>
<li><a href='http://stargrads.net/blogs/davinci/2009/12/the-physics-of-star-trek-by-lawrence-m-krauss/' rel='bookmark' title='Permanent Link: The Physics of Star Trek by Lawrence M. Krauss'>The Physics of Star Trek by Lawrence M. Krauss</a></li>
<li><a href='http://stargrads.net/blogs/davinci/2008/11/gifted-program-in-mississauga/' rel='bookmark' title='Permanent Link: Gifted program in Mississauga'>Gifted program in Mississauga</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://stargrads.net/blogs/davinci/2009/11/perimeter-scholars-international-masters-program-in-theoretical-physics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Programming exercise: interweaved strings</title>
		<link>http://stargrads.net/blogs/davinci/2009/11/programming-exercise-interweaved-strings/</link>
		<comments>http://stargrads.net/blogs/davinci/2009/11/programming-exercise-interweaved-strings/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 01:45:33 +0000</pubDate>
		<dc:creator>davinci</dc:creator>
				<category><![CDATA[programming and technical issues]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[dynamic programming]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[programming exercises]]></category>

		<guid isPermaLink="false">http://stargrads.net/blogs/davinci/?p=2574</guid>
		<description><![CDATA[
Another programming exercise.  The problem is to determine whether one string can be formed by interweaving two others.
]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t quite remember where I saw this problem, but I&#8217;m sure it&#8217;s appeared in a number of places.  Given two strings \(s\) and \(t\), determine whether a string \(u\) is formed by interweaving \(s\) and \(t\).  That is, determine whether \(u\) can be formed by taking the first few characters of (say) \(s\), followed by the first few characters of \(t\), then the next few characters of \(s\), and so on.  For example, the string &#8220;abccdcxey&#8221; can be formed by interweaving &#8220;abcde&#8221; with &#8220;ccxy&#8221;<span id="more-2574"></span>.<!--adsensestart--></p>
<p>I took way too long thinking about how to set up the problem than I should have.  In the end, I decided to quickly write up a solution that is easy to code, even if it may not be optimal.  The solution uses an \((m+1) \times (n+1)\) table, with indices starting from \(0\), where the \((i,j)\) entry is a boolean value indicating whether it&#8217;s possible to form the \((i+j)\)-character prefix of \(u\) from the first \(i\) characters of \(s\) and the first \(j\) characters of \(t\).<!--adsensestop--></p>
<p>Let \(m\) and \(n\) be the lengths of \(s\) and \(t\), respectively.  Assume that \(u\) is of length \(m+n\).  (This can be easily checked and handled at the beginning.) The function that determines whether \(u\) is formed by interweaving \(s\) and \(t\) is as follows:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre></td><td class="code"><pre class="c" style="font-family:monospace;">bool interweave<span style="color: #009900;">&#40;</span><span style="color: #993333;">char</span> <span style="color: #339933;">*</span>s<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> m<span style="color: #339933;">,</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>t<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> n<span style="color: #339933;">,</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>u<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    bool <span style="color: #339933;">**</span>table <span style="color: #339933;">=</span> new_table<span style="color: #009900;">&#40;</span>m<span style="color: #339933;">+</span><span style="color: #0000dd;">1</span><span style="color: #339933;">,</span> n<span style="color: #339933;">+</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>    
    table<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">true</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span> <span style="color: #993333;">int</span> row <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> row <span style="color: #339933;">&lt;</span> m<span style="color: #339933;">+</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span> row<span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span> <span style="color: #993333;">int</span> col <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> col <span style="color: #339933;">&lt;</span> n<span style="color: #339933;">+</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span> col<span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> table<span style="color: #009900;">&#91;</span>row<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>col<span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> row <span style="color: #339933;">!=</span> m <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    table<span style="color: #009900;">&#91;</span>row<span style="color: #339933;">+</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>col<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>s<span style="color: #009900;">&#91;</span>row<span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> u<span style="color: #009900;">&#91;</span>row<span style="color: #339933;">+</span>col<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
                <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> col <span style="color: #339933;">!=</span> n <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    table<span style="color: #009900;">&#91;</span>row<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>col<span style="color: #339933;">+</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>t<span style="color: #009900;">&#91;</span>col<span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> u<span style="color: #009900;">&#91;</span>row<span style="color: #339933;">+</span>col<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    bool result <span style="color: #339933;">=</span> table<span style="color: #009900;">&#91;</span>m<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>n<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    delete table<span style="color: #339933;">;</span>
    <span style="color: #b1b100;">return</span> result<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>When programming on the whiteboard, it&#8217;s important not to get bogged down in details.  In the above, I&#8217;ve assumed the existence of a function <code>new_table(rows,cols)</code> which returns a two-dimensional array of <code>bool</code>s, of the requested number of rows and columns, with all entries initialised to <code>false</code>.  This is simple enough to implement that I hope the interviewer won&#8217;t actually ask me to write it out during the interview, but in case I have to do so, here it is:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="c" style="font-family:monospace;">bool <span style="color: #339933;">**</span>new_table<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> rows<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> cols<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    bool <span style="color: #339933;">**</span>table <span style="color: #339933;">=</span> new bool<span style="color: #339933;">*</span><span style="color: #009900;">&#91;</span>rows<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span> <span style="color: #993333;">int</span> i <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> rows<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        table<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> new bool<span style="color: #009900;">&#91;</span>cols<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span> <span style="color: #993333;">int</span> j <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> j <span style="color: #339933;">&lt;</span> cols<span style="color: #339933;">;</span> j<span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            table<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>j<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">false</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">return</span> table<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>The algorithm runs in time \(O(m \times n)\) and also takes that much space.  I wasn&#8217;t really satisfied with this solution because it doesn&#8217;t make use of the fact that the same prefix of \(u\) can be formed by interweaving prefixes of \(s\) and \(t\) in different ways.  For example, &#8220;abcc&#8221; can be formed by interweaving &#8220;abc&#8221; and &#8220;c&#8221; in two different ways.  Now, the above algorithm doesn&#8217;t perform redundant calculations, but only because we&#8217;re sweeping the table row-by-row in an orderly fashion.  </p>
<p>One can, of course, contrive values for which most of the table actually needs to be visited, but for most values of \(s\) and \(t\), if one or more paths from the upper left corner to the lower right corner of the table exists, the only entries of the table that need to be visited are likely to be very close to these paths.  It makes sense therefore to keep track of which entries in the table are actually necessary to visit.  </p>
<p>The following code is closer to the algorithm I have in mind:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
</pre></td><td class="code"><pre class="c" style="font-family:monospace;">bool interweave<span style="color: #009900;">&#40;</span><span style="color: #993333;">char</span> <span style="color: #339933;">*</span>s<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> m<span style="color: #339933;">,</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>t<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> n<span style="color: #339933;">,</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>u<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    queue q <span style="color: #339933;">=</span> new queue<span style="color: #009900;">&#40;</span>m<span style="color: #339933;">+</span><span style="color: #0000dd;">1</span><span style="color: #339933;">,</span>n<span style="color: #339933;">+</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    q.<span style="color: #202020;">enqueue</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">0</span><span style="color: #339933;">,</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    bool result <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">false</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span>q.<span style="color: #202020;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #993333;">int</span> row<span style="color: #339933;">,</span> col<span style="color: #339933;">;</span>
        q.<span style="color: #202020;">dequeue</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>row<span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>col<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> row <span style="color: #339933;">==</span> m <span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span> col <span style="color: #339933;">==</span> n <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            result <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">true</span><span style="color: #339933;">;</span>
            <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> row <span style="color: #339933;">!=</span> m <span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span> s<span style="color: #009900;">&#91;</span>row<span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> u<span style="color: #009900;">&#91;</span>row<span style="color: #339933;">+</span>col<span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span>q.<span style="color: #202020;">marked</span><span style="color: #009900;">&#40;</span>row<span style="color: #339933;">+</span><span style="color: #0000dd;">1</span><span style="color: #339933;">,</span>col<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            q.<span style="color: #202020;">enqueue</span><span style="color: #009900;">&#40;</span>row<span style="color: #339933;">+</span><span style="color: #0000dd;">1</span><span style="color: #339933;">,</span>col<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> col <span style="color: #339933;">!=</span> n <span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span>t<span style="color: #009900;">&#91;</span>col<span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> u<span style="color: #009900;">&#91;</span>row<span style="color: #339933;">+</span>col<span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span>q.<span style="color: #202020;">marked</span><span style="color: #009900;">&#40;</span>row<span style="color: #339933;">,</span>col<span style="color: #339933;">+</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            q.<span style="color: #202020;">enqueue</span><span style="color: #009900;">&#40;</span>row<span style="color: #339933;">,</span>col<span style="color: #339933;">+</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    delete queue<span style="color: #339933;">;</span>
    <span style="color: #b1b100;">return</span> result<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>In the above, I&#8217;ve assumed the existence of a <code>queue</code> class that allows me to enqueue and dequeue pairs of integers consisting of a row and a column.  A row-column pair is enqueued only if it corresponds to a prefix of \(u\) that can be formed by interweaving a prefix of \(s\) and a prefix of \(t\).  Furthermore, the <code>queue</code> class also keeps track of whether a pair has <em>ever</em> been enqueued.  The <code>marked</code> function returns true if that&#8217;s the case, and false otherwise.  It can do this either using a two-dimensional array, as before, or it can use a fancier structure that trades off time for savings in space.  </p>
<p>If a two-dimensional array is used, the algorithm will still require \(O(m \times n)\) time just to initialise it.  However, the main loop in the <code>interweave</code> function will be \(O(m+n)\) for inputs for which there is little overlap or repetition in the input strings.</p>
<p>&#8211; davinci 11848</p>




	<a rel="nofollow"  href="http://stargrads.net/blogs/davinci/feed/" title="RSS"><img src="http://stargrads.net/common/images/handycons/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=Programming%20exercise%3A%20interweaved%20strings&amp;body=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fprogramming-exercise-interweaved-strings%2F" title="email"><img src="http://stargrads.net/common/images/handycons/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fprogramming-exercise-interweaved-strings%2F&amp;t=Programming%20exercise%3A%20interweaved%20strings" title="Facebook"><img src="http://stargrads.net/common/images/handycons/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=Programming%20exercise%3A%20interweaved%20strings%20-%20http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fprogramming-exercise-interweaved-strings%2F" title="Twitter"><img src="http://stargrads.net/common/images/handycons/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=Programming%20exercise%3A%20interweaved%20strings&amp;link=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fprogramming-exercise-interweaved-strings%2F" title="FriendFeed"><img src="http://stargrads.net/common/images/handycons/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fprogramming-exercise-interweaved-strings%2F&amp;title=Programming%20exercise%3A%20interweaved%20strings&amp;notes=Another%20programming%20exercise.%20%20The%20problem%20is%20to%20determine%20whether%20one%20string%20can%20be%20formed%20by%20interweaving%20two%20others." title="del.icio.us"><img src="http://stargrads.net/common/images/handycons/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fprogramming-exercise-interweaved-strings%2F&amp;title=Programming%20exercise%3A%20interweaved%20strings&amp;bodytext=Another%20programming%20exercise.%20%20The%20problem%20is%20to%20determine%20whether%20one%20string%20can%20be%20formed%20by%20interweaving%20two%20others." title="Digg"><img src="http://stargrads.net/common/images/handycons/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fprogramming-exercise-interweaved-strings%2F&amp;title=Programming%20exercise%3A%20interweaved%20strings&amp;annotation=Another%20programming%20exercise.%20%20The%20problem%20is%20to%20determine%20whether%20one%20string%20can%20be%20formed%20by%20interweaving%20two%20others." title="Google Bookmarks"><img src="http://stargrads.net/common/images/handycons/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://bookmarks.yahoo.com/toolbar/savebm?u=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fprogramming-exercise-interweaved-strings%2F&amp;t=Programming%20exercise%3A%20interweaved%20strings&opener=bm&amp;ei=UTF-8&amp;d=Another%20programming%20exercise.%20%20The%20problem%20is%20to%20determine%20whether%20one%20string%20can%20be%20formed%20by%20interweaving%20two%20others." title="Yahoo! Bookmarks"><img src="http://stargrads.net/common/images/handycons/yahoomyweb.png" title="Yahoo! Bookmarks" alt="Yahoo! Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fprogramming-exercise-interweaved-strings%2F&amp;title=Programming%20exercise%3A%20interweaved%20strings" title="StumbleUpon"><img src="http://stargrads.net/common/images/handycons/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fprogramming-exercise-interweaved-strings%2F" title="Technorati"><img src="http://stargrads.net/common/images/handycons/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fprogramming-exercise-interweaved-strings%2F&amp;title=Programming%20exercise%3A%20interweaved%20strings" title="Reddit"><img src="http://stargrads.net/common/images/handycons/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>


<br/><br/><img src="http://stargrads.net/blogs/davinci/?ak_action=api_record_view&id=2574&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://stargrads.net/blogs/davinci/2009/10/programming-exercise-permutations-of-a-string/' rel='bookmark' title='Permanent Link: Programming exercise: permutations of a string'>Programming exercise: permutations of a string</a></li>
<li><a href='http://stargrads.net/blogs/davinci/2009/10/programming-exercise-combinations-of-a-string/' rel='bookmark' title='Permanent Link: Programming exercise: combinations of a string'>Programming exercise: combinations of a string</a></li>
<li><a href='http://stargrads.net/blogs/davinci/2009/11/programming-exercise-red-white-blue-sorting/' rel='bookmark' title='Permanent Link: Programming exercise: red-white-blue sorting'>Programming exercise: red-white-blue sorting</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://stargrads.net/blogs/davinci/2009/11/programming-exercise-interweaved-strings/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Programming exercise: red-white-blue sorting</title>
		<link>http://stargrads.net/blogs/davinci/2009/11/programming-exercise-red-white-blue-sorting/</link>
		<comments>http://stargrads.net/blogs/davinci/2009/11/programming-exercise-red-white-blue-sorting/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 20:52:38 +0000</pubDate>
		<dc:creator>davinci</dc:creator>
				<category><![CDATA[programming and technical issues]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[programming exercises]]></category>
		<category><![CDATA[quicksort]]></category>
		<category><![CDATA[sorting]]></category>

		<guid isPermaLink="false">http://stargrads.net/blogs/davinci/?p=2549</guid>
		<description><![CDATA[
I&#8217;ve been practising coding on the whiteboard for job interviews.  This is very different than coding in front of a computer which has a keyboard, a monitor, and a nice editing program that allows you to correct your mistakes and type repetitive text very quickly.  I&#8217;m trying to keep my programs simple and [...]
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been practising coding on the whiteboard for job interviews.  This is very different than coding in front of a computer which has a keyboard, a monitor, and a nice editing program that allows you to correct your mistakes and type repetitive text very quickly.  I&#8217;m trying to keep my programs simple and short, and writing in a C-like pseudocode.</p>
<p>This exercise comes from Skiena&#8217;s <a href="http://www.amazon.ca/gp/product/1848000693?ie=UTF8&amp;tag=davincisnoteb-20&amp;linkCode=as2&amp;camp=15121&amp;creative=330641&amp;creativeASIN=1848000693"><i>The Algorithm Design Manual</i></a><img src="http://www.assoc-amazon.ca/e/ir?t=davincisnoteb-20&amp;l=as2&amp;o=15&amp;a=1848000693" width="1" height="1" border="0" alt="" style="border:none !important;margin:0px !important" /><sup><a class='footnote' id='note-2549-1' href='#footnote-2549-skiena08'>[1]</a></sup>\(\)<span id="more-2549"></span>.<!--adsensestart--></p>
<p>You are given an array \(A\) of \(n\) elements, each of which is one of <em>red</em>, <em>white</em>, or <em>blue</em>.  The only permitted operations on \(A\) are to examine an item at position \(i\) using <code>Examine(i)</code>, and to swap two items at positions \(i\) and \(j\) using <code>Swap(i,j)</code>.  The problem is to sort the elements as efficiently as possible, such that the elements are in the order <em>red</em>, followed by <em>white</em>, then finally <em>blue</em>.</p>
<p>The trick to coding on a whiteboard is to first draw some simple visual examples, and use them to talk your interviewer (or yourself) through how the algorithm is supposed to work, before writing down any actual code.  It&#8217;s very important that you have the algorithm you want to code before you start coding, because any editing other than very minor changes is basically impossible on a whiteboard.</p>
<p>The first thing to notice is that we can do better than the standard \(O(n\log n)\) sorting algorithms, since the number of different values for the elements is a small constant.  My first thought was to make one pass of the array to count the number of red, white, and blue elements, one more pass to put all the red elements in front, and a final pass to put the white elements before the blue ones.  While this algorithm is linear time, which is asymptotically the best you can do, with a little thought and a little bookkeeping, it&#8217;s possible to do everything in just one pass of the array.<!--adsensestop--></p>
<p>The idea is as follows.  Keep two &#8220;pointers&#8221;, say \(r\) and \(b\), which begin at the front and back respectively, and which keep track of the places where the next red and blue elements should go.  Now sweep the array from front to back.  </p>
<p>If the current position has a blue element, swap it to position \(b\).  Now, we decrement \(b\), but we don&#8217;t advance the position of the sweep yet, because we might have just swapped in another blue element.  This rule ensures that there are no blue elements behind us (i.e., towards the front of the array).  </p>
<p>Dealing with a red element is a <em>bit</em> trickier, since both the \(r\) pointer and the sweep&#8217;s position are advancing.  If we&#8217;re at the same position as the \(r\) pointer, there&#8217;s a contiguous block of red elements behind us, and we can simply increment \(r\) and move on to the next position.  If we&#8217;re ahead of the \(r\) pointer, we can swap the red element to that position, and increment \(r\).  Note that we can only ever swap in a white element, since we&#8217;ve guaranteed that there are no blue elements behind us, and \(r\) is always beyond the continguous block of known red elements at the front.</p>
<p>Finally, if the current position has a white element, we can just skip over it.  If it&#8217;s in the wrong position, it&#8217;ll be dealt with later when we encounter the red element it needs to be swapped with.</p>
<p>The loop terminates when our sweep hits the contiguous block of blue elements at the back of \(A\), i.e., when \(pos &gt; b\).  For simplicity, we assume that \(n \geq 1\) (which we can always check for before we begin).</p>
<p>This is the algorithm I came up with on the whiteboard:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
</pre></td><td class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">int</span> r<span style="color: #339933;">,</span> b<span style="color: #339933;">,</span> pos<span style="color: #339933;">;</span>
&nbsp;
r <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> b <span style="color: #339933;">=</span> n<span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span>Examine<span style="color: #009900;">&#40;</span>r<span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #ff0000;">'R'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> r<span style="color: #339933;">++;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span>Examine<span style="color: #009900;">&#40;</span>b<span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #ff0000;">'B'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> b<span style="color: #339933;">--;</span> <span style="color: #009900;">&#125;</span>
&nbsp;
pos <span style="color: #339933;">=</span> r<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span> pos <span style="color: #339933;">&lt;=</span> b <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #993333;">char</span> val <span style="color: #339933;">=</span> Examine<span style="color: #009900;">&#40;</span>pos<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> val <span style="color: #339933;">==</span> <span style="color: #ff0000;">'B'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        Swap<span style="color: #009900;">&#40;</span>b<span style="color: #339933;">,</span> pos<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        b<span style="color: #339933;">--;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> val <span style="color: #339933;">==</span> <span style="color: #ff0000;">'R'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> r <span style="color: #339933;">&lt;</span> pos <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            Swap<span style="color: #009900;">&#40;</span>r<span style="color: #339933;">,</span> pos<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
            pos<span style="color: #339933;">++;</span>
        <span style="color: #009900;">&#125;</span>
        r<span style="color: #339933;">++;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> val <span style="color: #339933;">==</span> <span style="color: #ff0000;">'W'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        pos<span style="color: #339933;">++;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>I&#8217;ve assumed that <code>Examine(i)</code> returns one of <code>'R'</code>, <code>'W'</code>, or <code>'B'</code>.  The \(pos\) variable keeps track of the position as I sweep the array from front to back.  The two initial loops skip over any red elements at the front and any blue elements at the back of the array (these are not strictly necessary, but make things a bit faster in some cases).  Each element is examined exactly once, for a total run time of \(n\), making this the most efficient algorithm possible.  </p>
<p>&#8211; davinci 11847</p>




	<a rel="nofollow"  href="http://stargrads.net/blogs/davinci/feed/" title="RSS"><img src="http://stargrads.net/common/images/handycons/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=Programming%20exercise%3A%20red-white-blue%20sorting&amp;body=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fprogramming-exercise-red-white-blue-sorting%2F" title="email"><img src="http://stargrads.net/common/images/handycons/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fprogramming-exercise-red-white-blue-sorting%2F&amp;t=Programming%20exercise%3A%20red-white-blue%20sorting" title="Facebook"><img src="http://stargrads.net/common/images/handycons/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=Programming%20exercise%3A%20red-white-blue%20sorting%20-%20http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fprogramming-exercise-red-white-blue-sorting%2F" title="Twitter"><img src="http://stargrads.net/common/images/handycons/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=Programming%20exercise%3A%20red-white-blue%20sorting&amp;link=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fprogramming-exercise-red-white-blue-sorting%2F" title="FriendFeed"><img src="http://stargrads.net/common/images/handycons/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fprogramming-exercise-red-white-blue-sorting%2F&amp;title=Programming%20exercise%3A%20red-white-blue%20sorting&amp;notes=I%27ve%20been%20practising%20coding%20on%20the%20whiteboard%20for%20job%20interviews.%20%20This%20is%20very%20different%20than%20coding%20in%20front%20of%20a%20computer%20which%20has%20a%20keyboard%2C%20a%20monitor%2C%20and%20a%20nice%20editing%20program%20that%20allows%20you%20to%20correct%20your%20mistakes%20and%20type%20repetitive%20text" title="del.icio.us"><img src="http://stargrads.net/common/images/handycons/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fprogramming-exercise-red-white-blue-sorting%2F&amp;title=Programming%20exercise%3A%20red-white-blue%20sorting&amp;bodytext=I%27ve%20been%20practising%20coding%20on%20the%20whiteboard%20for%20job%20interviews.%20%20This%20is%20very%20different%20than%20coding%20in%20front%20of%20a%20computer%20which%20has%20a%20keyboard%2C%20a%20monitor%2C%20and%20a%20nice%20editing%20program%20that%20allows%20you%20to%20correct%20your%20mistakes%20and%20type%20repetitive%20text" title="Digg"><img src="http://stargrads.net/common/images/handycons/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fprogramming-exercise-red-white-blue-sorting%2F&amp;title=Programming%20exercise%3A%20red-white-blue%20sorting&amp;annotation=I%27ve%20been%20practising%20coding%20on%20the%20whiteboard%20for%20job%20interviews.%20%20This%20is%20very%20different%20than%20coding%20in%20front%20of%20a%20computer%20which%20has%20a%20keyboard%2C%20a%20monitor%2C%20and%20a%20nice%20editing%20program%20that%20allows%20you%20to%20correct%20your%20mistakes%20and%20type%20repetitive%20text" title="Google Bookmarks"><img src="http://stargrads.net/common/images/handycons/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://bookmarks.yahoo.com/toolbar/savebm?u=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fprogramming-exercise-red-white-blue-sorting%2F&amp;t=Programming%20exercise%3A%20red-white-blue%20sorting&opener=bm&amp;ei=UTF-8&amp;d=I%27ve%20been%20practising%20coding%20on%20the%20whiteboard%20for%20job%20interviews.%20%20This%20is%20very%20different%20than%20coding%20in%20front%20of%20a%20computer%20which%20has%20a%20keyboard%2C%20a%20monitor%2C%20and%20a%20nice%20editing%20program%20that%20allows%20you%20to%20correct%20your%20mistakes%20and%20type%20repetitive%20text" title="Yahoo! Bookmarks"><img src="http://stargrads.net/common/images/handycons/yahoomyweb.png" title="Yahoo! Bookmarks" alt="Yahoo! Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fprogramming-exercise-red-white-blue-sorting%2F&amp;title=Programming%20exercise%3A%20red-white-blue%20sorting" title="StumbleUpon"><img src="http://stargrads.net/common/images/handycons/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fprogramming-exercise-red-white-blue-sorting%2F" title="Technorati"><img src="http://stargrads.net/common/images/handycons/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fprogramming-exercise-red-white-blue-sorting%2F&amp;title=Programming%20exercise%3A%20red-white-blue%20sorting" title="Reddit"><img src="http://stargrads.net/common/images/handycons/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>


<br/><br/><img src="http://stargrads.net/blogs/davinci/?ak_action=api_record_view&id=2549&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://stargrads.net/blogs/davinci/2009/11/programming-exercise-interweaved-strings/' rel='bookmark' title='Permanent Link: Programming exercise: interweaved strings'>Programming exercise: interweaved strings</a></li>
<li><a href='http://stargrads.net/blogs/davinci/2009/09/programming-exercise-maximum-value-in-integer-array-part-1/' rel='bookmark' title='Permanent Link: Programming exercise: maximum value in integer array, part 1'>Programming exercise: maximum value in integer array, part 1</a></li>
<li><a href='http://stargrads.net/blogs/davinci/2009/09/programming-exercise-hello-world/' rel='bookmark' title='Permanent Link: Programming exercise: Hello, world!'>Programming exercise: Hello, world!</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://stargrads.net/blogs/davinci/2009/11/programming-exercise-red-white-blue-sorting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Persian Soft Keyboard and Applications for Android</title>
		<link>http://stargrads.net/blogs/davinci/2009/11/persian-soft-keyboard-and-applications-for-android/</link>
		<comments>http://stargrads.net/blogs/davinci/2009/11/persian-soft-keyboard-and-applications-for-android/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 06:34:28 +0000</pubDate>
		<dc:creator>davinci</dc:creator>
				<category><![CDATA[languages and linguistics]]></category>
		<category><![CDATA[programming and technical issues]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[complex text layout]]></category>
		<category><![CDATA[Dream]]></category>
		<category><![CDATA[glyph-shaping]]></category>
		<category><![CDATA[HTC]]></category>
		<category><![CDATA[input method]]></category>
		<category><![CDATA[Persian]]></category>
		<category><![CDATA[soft keyboard]]></category>
		<category><![CDATA[virtual keyboard]]></category>

		<guid isPermaLink="false">http://stargrads.net/blogs/davinci/?p=2534</guid>
		<description><![CDATA[
In this post, I discuss a new application I wrote for my Android smart phone, a Persian Soft Keyboard.
]]></description>
			<content:encoded><![CDATA[<p><b>Update (July 25, 2010)</b>: Please read this before posting a comment, sending me an e-mail, or giving the software a rating on the Android Market.  Also, note that the remarks below pertain to Android 2.2 and below, and may become obsolete in the future.                                                                                                                                                                      </p>
<p>About the <b>keyboard</b>:</p>
<ul>
<li>The app is a <em>keyboard</em>.  Please do <em>not</em> say that &#8220;it doesn&#8217;t work&#8221; because &#8220;I see only squares&#8221;.  <b>A keyboard does not help you to render fonts or shape glyphs.</b>  This software is meant only for people who can <em>already</em> display Persian on their phones, but have no means of input.  With that being said, I understand that many people who are looking for an input method for Persian are <em>also</em> looking for a way to display it.  Just don&#8217;t confuse the two functionalities.  (For information on how to display Persian, read on to the next section below.)</li>
<li>There is nothing sinister about the warning that the software may see sensitive information such as passwords and credit card numbers.  <b>It can see anything you type when it is the active keyboard &#8212; <em>and so can every other soft keyboard</em>.</b>  It does <em>not</em> do anything with this information except to use it to guess what you&#8217;re typing.  If you don&#8217;t want your password or credit card number to be read by the app, just switch to the default Android keyboard when you need to type something secret.  (Unless, of course, your password is actually in Persian.)</li>
<li>On most devices, you have to enable an input method after it&#8217;s installed by going into Settings, and <b>to switch input methods you hold the trackball or long-tap with your finger in a text input field</b>.  These depend on the operating system, and are not things that I can change.</li>
</ul>
<p>On <b>installing a font</b> and <b>rooting your phone</b>:</p>
<ul>
<li>To display Persian on Android, <b>it is <em>not sufficient</em> just to install a font.</b>  You also need to get the system to join the glyphs and to display them in right-to-left order.</li>
<li>To install a font, <b>you will need to root your phone</b>.  Instructions can be found by using a <a href="http://www.google.com">search engine</a>.</li>
<li>If you are unable to follow the instructions yourself, or cannot find someone who is <em>physically present</em> to take you through the steps, it is unlikely that anyone can help you online.  It&#8217;s not a trivial task in most cases, and nobody wants to be responsible for accidentally bricking your phone.  I will try to help, but please understand that your request is non-trivial.  Furthermore, please see the remark above about it not being sufficient just to install a font.  Even after a font is installed, there is still a lot of work to do to display Persian on Android.  If you do not understand how to root a phone yourself, you will very likely not understand how to go through the rest of the process either.</li>
</ul>
<p>About <b>displaying Persian</b> on your phone:</p>
<ul>
<li><a href="http://farsitel.com/">FarsiTel</a> has just announced a Persianised version of Android.  If you have a newer Android (2.1 and up) and want a completely Persian ROM, start your investigations there.  Note that this solution includes a keyboard also (and it is a different one from mine).</li>
<li>You can also try <a href="http://code.google.com/p/arabicandroid/downloads/list">Arabic Android</a> for displaying Persian.  Yes, it&#8217;s designed for Arabic, but it works for Persian also.  You may have to pay to obtain right-to-left functionality.  Look for the &#8220;Arabic Android&#8221; app in the market once you have the appropriate image from the site installed.</li>
<li>There is an app on the Android Market called &#8220;<a href="http://www.bohlool.net/android-apps/persian-browser">Persian Browser</a>&#8221; that will enable font-shaping in the web browser only.  If your browser displays Perso-Arabic glyphs but don&#8217;t join them or display them right-to-left, you can download this app to fix the problem.</li>
<li>To use these ROMs/apps, you may need to root your phone and/or install fonts.  See the section above.</li>
<li><b>Disclaimer: I am not involved with these projects, and (to my knowledge) neither is my employer.</b></li>
</ul>
<p>And, finally, I cannot make any comments about the state of official support for Persian on Android due to the terms of my employment.  This is my personal web site, and is unaffiliated with my employer.  Anything I write here about Persian support on Android reflects my personal opinion only.</p>
<p>The original post (from Nov. 16, 2009) follows.</p>
<hr />
<p>I recently got a new smart phone &#8212; an Android-powered HTC Dream.  As I wrote in a <a href="http://stargrads.net/blogs/davinci/2009/09/mock-up-of-a-yudit-like-mobile-application/">previous post</a>, one of the first applications that I always look for is a multilingual dictionary, or at the very least a way to enter input in languages other than English<span id="more-2534"></span>.<!--adsensestart--></p>
<p>It took me almost no time to write up a Persian Soft Keyboard, which I have put on the <a href="http://www.android.com/market/">Android Market</a>.  (If you&#8217;re viewing this page on an Android device, you can download the application directly by clicking <a href="net.stargrads.android.inputmethod.persiansoftkeyboard">this link</a>.)</p>
<p>Because Android is open source, it was remarkably easy to learn how to use the <a href="http://developer.android.com/sdk/"><abbr title="software development kit">SDK</abbr></a>.  Unfortunately, despite this, there are a number of design decisions which make it difficult to enable Android devices for the Persian language (or many other languages).  For one thing, it is impossible for the average user to install a new font, and the default fonts that ship with most Android phones don&#8217;t cover character sets outside of the Latin-based alphabets.  For another, built-in support for complex text layout is very incomplete, and that includes the bidirectional text display and glyph-shaping which are essential for properly rendering Persian text.  </p>
<p>I can understand the decision to leave these features out, since space is limited on most Android devices.  However, this means that users who use languages other than English end up having to go to a lot of trouble to get these languages to work, such as downloading versions of applications capable of handling their specific language.  It would have been much simpler if the base Android system had been packaged with a font that covered the Unicode characters for the most common languages in the world and applications that were aware of how to lay out their writing systems.</p>
<p>As things are, even with a Persian font installed, most applications still don&#8217;t display Persian text properly because of directionality and glyph-shaping problems.  I&#8217;ve included an option for the Persian Soft Keyboard to output Unicode presentation forms, i.e., glyphs which are already shaped and joined.  Even though this option does not comply with the Unicode standard, it allows readable Persian text to be entered into and sent through the default SMS application, for example.  (Whether the recipient will be able to read the message at the other end is another issue.)<!--adsensestop--></p>
<p>Currently, I&#8217;m bundling a simple note pad and a translator application with the Persian Soft Keyboard package.  At the moment, the available note pad applications can&#8217;t handle right-to-left text, and the available translators don&#8217;t do glyph-shaping correctly.  I hope that more Android software authors make their applications aware of languages other than English, because I don&#8217;t really want to support or maintain applications which are redundant.</p>
<p>&#8211; davinci 11843</p>




	<a rel="nofollow"  href="http://stargrads.net/blogs/davinci/feed/" title="RSS"><img src="http://stargrads.net/common/images/handycons/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=Persian%20Soft%20Keyboard%20and%20Applications%20for%20Android&amp;body=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fpersian-soft-keyboard-and-applications-for-android%2F" title="email"><img src="http://stargrads.net/common/images/handycons/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fpersian-soft-keyboard-and-applications-for-android%2F&amp;t=Persian%20Soft%20Keyboard%20and%20Applications%20for%20Android" title="Facebook"><img src="http://stargrads.net/common/images/handycons/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=Persian%20Soft%20Keyboard%20and%20Applications%20for%20Android%20-%20http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fpersian-soft-keyboard-and-applications-for-android%2F" title="Twitter"><img src="http://stargrads.net/common/images/handycons/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=Persian%20Soft%20Keyboard%20and%20Applications%20for%20Android&amp;link=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fpersian-soft-keyboard-and-applications-for-android%2F" title="FriendFeed"><img src="http://stargrads.net/common/images/handycons/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fpersian-soft-keyboard-and-applications-for-android%2F&amp;title=Persian%20Soft%20Keyboard%20and%20Applications%20for%20Android&amp;notes=In%20this%20post%2C%20I%20discuss%20a%20new%20application%20I%20wrote%20for%20my%20Android%20smart%20phone%2C%20a%20Persian%20Soft%20Keyboard." title="del.icio.us"><img src="http://stargrads.net/common/images/handycons/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fpersian-soft-keyboard-and-applications-for-android%2F&amp;title=Persian%20Soft%20Keyboard%20and%20Applications%20for%20Android&amp;bodytext=In%20this%20post%2C%20I%20discuss%20a%20new%20application%20I%20wrote%20for%20my%20Android%20smart%20phone%2C%20a%20Persian%20Soft%20Keyboard." title="Digg"><img src="http://stargrads.net/common/images/handycons/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fpersian-soft-keyboard-and-applications-for-android%2F&amp;title=Persian%20Soft%20Keyboard%20and%20Applications%20for%20Android&amp;annotation=In%20this%20post%2C%20I%20discuss%20a%20new%20application%20I%20wrote%20for%20my%20Android%20smart%20phone%2C%20a%20Persian%20Soft%20Keyboard." title="Google Bookmarks"><img src="http://stargrads.net/common/images/handycons/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://bookmarks.yahoo.com/toolbar/savebm?u=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fpersian-soft-keyboard-and-applications-for-android%2F&amp;t=Persian%20Soft%20Keyboard%20and%20Applications%20for%20Android&opener=bm&amp;ei=UTF-8&amp;d=In%20this%20post%2C%20I%20discuss%20a%20new%20application%20I%20wrote%20for%20my%20Android%20smart%20phone%2C%20a%20Persian%20Soft%20Keyboard." title="Yahoo! Bookmarks"><img src="http://stargrads.net/common/images/handycons/yahoomyweb.png" title="Yahoo! Bookmarks" alt="Yahoo! Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fpersian-soft-keyboard-and-applications-for-android%2F&amp;title=Persian%20Soft%20Keyboard%20and%20Applications%20for%20Android" title="StumbleUpon"><img src="http://stargrads.net/common/images/handycons/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fpersian-soft-keyboard-and-applications-for-android%2F" title="Technorati"><img src="http://stargrads.net/common/images/handycons/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F11%2Fpersian-soft-keyboard-and-applications-for-android%2F&amp;title=Persian%20Soft%20Keyboard%20and%20Applications%20for%20Android" title="Reddit"><img src="http://stargrads.net/common/images/handycons/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>


<br/><br/><img src="http://stargrads.net/blogs/davinci/?ak_action=api_record_view&id=2534&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://stargrads.net/blogs/davinci/2009/12/glyph-shaping-poster-fail/' rel='bookmark' title='Permanent Link: Glyph-shaping poster fail'>Glyph-shaping poster fail</a></li>
<li><a href='http://stargrads.net/blogs/davinci/2009/05/the-causes-of-my-depression-part-17-my-frivolous-web-site-and-how-i-learned-persian/' rel='bookmark' title='Permanent Link: The causes of my depression, part 17: my &#8220;frivolous&#8221; web site and how I learned Persian'>The causes of my depression, part 17: my &#8220;frivolous&#8221; web site and how I learned Persian</a></li>
<li><a href='http://stargrads.net/blogs/davinci/2009/09/mock-up-of-a-yudit-like-mobile-application/' rel='bookmark' title='Permanent Link: Mock-up of a Yudit-like mobile application'>Mock-up of a Yudit-like mobile application</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://stargrads.net/blogs/davinci/2009/11/persian-soft-keyboard-and-applications-for-android/feed/</wfw:commentRss>
		<slash:comments>64</slash:comments>
		</item>
		<item>
		<title>Lists of programming exercises</title>
		<link>http://stargrads.net/blogs/davinci/2009/10/lists-of-programming-exercises/</link>
		<comments>http://stargrads.net/blogs/davinci/2009/10/lists-of-programming-exercises/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 03:34:52 +0000</pubDate>
		<dc:creator>davinci</dc:creator>
				<category><![CDATA[programming and technical issues]]></category>
		<category><![CDATA[programming exercises]]></category>

		<guid isPermaLink="false">http://stargrads.net/blogs/davinci/?p=2507</guid>
		<description><![CDATA[
A list of web sites with programming exercises, and also a few relevant books.
]]></description>
			<content:encoded><![CDATA[<p><!--noadsense-->I&#8217;ve collected a number of web sites with lists of programming exercises, which I&#8217;m going through for practice.</p>
<p>In no particular order, these are<span id="more-2507"></span>:</p>
<ul>
<li><a href="http://projecteuler.net/">Project Euler</a> (a spin-off of <a href="http://mathschallenge.net/">MathsChallenge.net</a>)
</li>
<li><a href="http://www.spoj.pl/problems/classical/">Sphere Online Judge</a>
</li>
<li><a href="http://www.topcoder.com/tc">TopCoder</a>
</li>
<li><a href="http://codekata.pragprog.com/2007/01/code_kata_backg.html">Code Kata</a>
</li>
<li><a href="http://icpc.baylor.edu/past/default.htm">The ACM International Collegiate Programming Contest &#8212; Past Problems</a>
</li>
<li><a href="http://acm.uva.es/contest/">Valladolid Online Judge</a>
</li>
</ul>
<p>The following are language-specific:</p>
<ul>
<li><a href="http://www.cprogramming.com/challenge.html">C/C++ Programming Challenge Problems</a>
</li>
<li><a href="http://cplus.about.com/od/programmingchallenges/Programming_Challenges.htm">About.com C/C++/C# Programming Challenges</a>
</li>
<li><a href="http://www.pythonchallenge.com/">Python Challenge</a>
</li>
<li><a href="http://rubyquiz.com/">Ruby Quiz</a>
</li>
</ul>
<p>And here are some books which may be relevant:</p>
<ul>
<li><a href="http://www.amazon.ca/gp/product/047012167X?ie=UTF8&amp;tag=davincisnoteb-20&amp;linkCode=as2&amp;camp=15121&amp;creative=330641&amp;creativeASIN=047012167X">Programming Interviews Exposed, by John Mongan, Noah Suojanen, and Eric Giguère</a><img src="http://www.assoc-amazon.ca/e/ir?t=davincisnoteb-20&amp;l=as2&amp;o=15&amp;a=047012167X" width="1" height="1" border="0" alt="" style="border:none !important;margin:0px !important" />
</li>
<li><a href="http://www.amazon.ca/gp/product/0201657880?ie=UTF8&amp;tag=davincisnoteb-20&amp;linkCode=as2&amp;camp=15121&amp;creative=330641&amp;creativeASIN=0201657880">Programming Pearls, by Jon Bentley</a><img src="http://www.assoc-amazon.ca/e/ir?t=davincisnoteb-20&amp;l=as2&amp;o=15&amp;a=0201657880" width="1" height="1" border="0" alt="" style="border:none !important;margin:0px !important" />
</li>
<li><a href="http://www.amazon.ca/gp/product/0470121688?ie=UTF8&amp;tag=davincisnoteb-20&amp;linkCode=as2&amp;camp=15121&amp;creative=330641&amp;creativeASIN=0470121688">Puzzles for Programmers and Pros, by Dennis Shasha </a><img src="http://www.assoc-amazon.ca/e/ir?t=davincisnoteb-20&amp;l=as2&amp;o=15&amp;a=0470121688" width="1" height="1" border="0" alt="" style="border:none !important;margin:0px !important" />
</li>
<li><a href="http://www.amazon.ca/gp/product/0387001638?ie=UTF8&amp;tag=davincisnoteb-20&amp;linkCode=as2&amp;camp=15121&amp;creative=330641&amp;creativeASIN=0387001638">Programming Challenges, by Steven S. Skiena </a><img src="http://www.assoc-amazon.ca/e/ir?t=davincisnoteb-20&amp;l=as2&amp;o=15&amp;a=0387001638" width="1" height="1" border="0" alt="" style="border:none !important;margin:0px !important" />
</li>
<li><a href="http://www.amazon.ca/gp/product/1848000693?ie=UTF8&amp;tag=davincisnoteb-20&amp;linkCode=as2&amp;camp=15121&amp;creative=330641&amp;creativeASIN=1848000693">The Algorithm Design Manual, by Steven S. Skiena</a><img src="http://www.assoc-amazon.ca/e/ir?t=davincisnoteb-20&amp;l=as2&amp;o=15&amp;a=1848000693" width="1" height="1" border="0" alt="" style="border:none !important;margin:0px !important" />
</li>
</ul>
<p>Since the exercises are judged, I probably won&#8217;t be posting solutions here.  My accounts on Project Euler, Sphere Online Judge, and TopCoder are all &#8220;dlyongemallo&#8221;.</p>
<p>&#8211; davinci 11814</p>




	<a rel="nofollow"  href="http://stargrads.net/blogs/davinci/feed/" title="RSS"><img src="http://stargrads.net/common/images/handycons/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=Lists%20of%20programming%20exercises&amp;body=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F10%2Flists-of-programming-exercises%2F" title="email"><img src="http://stargrads.net/common/images/handycons/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F10%2Flists-of-programming-exercises%2F&amp;t=Lists%20of%20programming%20exercises" title="Facebook"><img src="http://stargrads.net/common/images/handycons/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=Lists%20of%20programming%20exercises%20-%20http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F10%2Flists-of-programming-exercises%2F" title="Twitter"><img src="http://stargrads.net/common/images/handycons/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=Lists%20of%20programming%20exercises&amp;link=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F10%2Flists-of-programming-exercises%2F" title="FriendFeed"><img src="http://stargrads.net/common/images/handycons/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F10%2Flists-of-programming-exercises%2F&amp;title=Lists%20of%20programming%20exercises&amp;notes=A%20list%20of%20web%20sites%20with%20programming%20exercises%2C%20and%20also%20a%20few%20relevant%20books." title="del.icio.us"><img src="http://stargrads.net/common/images/handycons/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F10%2Flists-of-programming-exercises%2F&amp;title=Lists%20of%20programming%20exercises&amp;bodytext=A%20list%20of%20web%20sites%20with%20programming%20exercises%2C%20and%20also%20a%20few%20relevant%20books." title="Digg"><img src="http://stargrads.net/common/images/handycons/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F10%2Flists-of-programming-exercises%2F&amp;title=Lists%20of%20programming%20exercises&amp;annotation=A%20list%20of%20web%20sites%20with%20programming%20exercises%2C%20and%20also%20a%20few%20relevant%20books." title="Google Bookmarks"><img src="http://stargrads.net/common/images/handycons/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://bookmarks.yahoo.com/toolbar/savebm?u=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F10%2Flists-of-programming-exercises%2F&amp;t=Lists%20of%20programming%20exercises&opener=bm&amp;ei=UTF-8&amp;d=A%20list%20of%20web%20sites%20with%20programming%20exercises%2C%20and%20also%20a%20few%20relevant%20books." title="Yahoo! Bookmarks"><img src="http://stargrads.net/common/images/handycons/yahoomyweb.png" title="Yahoo! Bookmarks" alt="Yahoo! Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F10%2Flists-of-programming-exercises%2F&amp;title=Lists%20of%20programming%20exercises" title="StumbleUpon"><img src="http://stargrads.net/common/images/handycons/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F10%2Flists-of-programming-exercises%2F" title="Technorati"><img src="http://stargrads.net/common/images/handycons/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fstargrads.net%2Fblogs%2Fdavinci%2F2009%2F10%2Flists-of-programming-exercises%2F&amp;title=Lists%20of%20programming%20exercises" title="Reddit"><img src="http://stargrads.net/common/images/handycons/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>


<br/><br/><img src="http://stargrads.net/blogs/davinci/?ak_action=api_record_view&id=2507&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://stargrads.net/blogs/davinci/2009/09/programming-exercises-and-comparison-of-programming-languages/' rel='bookmark' title='Permanent Link: Programming exercises and comparison of programming languages'>Programming exercises and comparison of programming languages</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://stargrads.net/blogs/davinci/2009/10/lists-of-programming-exercises/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->