<?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/"
	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
>

<channel>
	<title>Shadowlessness</title>
	<atom:link href="http://yaserzt.com/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://yaserzt.com/blog</link>
	<description>Shadowlessness, and how it feels.</description>
	<lastBuildDate>Sun, 22 Aug 2010 05:43:18 +0000</lastBuildDate>
	<language>fa</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<!-- podcast_generator="podPress/8.8" - maintenance_release="8.8.6.1" -->
	<copyright>Copyright &#xA9; Shadowlessness 2010 </copyright>
	<managingEditor>y@yaserzt.com (Shadowlessness)</managingEditor>
	<webMaster>y@yaserzt.com (Shadowlessness)</webMaster>
	<category>posts</category>
	<image>
		<url>http://yaserzt.com/blog/wp-content/plugins/podpress/images/powered_by_podpress.jpg</url>
		<title>Shadowlessness</title>
		<link>http://yaserzt.com/blog</link>
		<width>144</width>
		<height>144</height>
	</image>
	<itunes:subtitle></itunes:subtitle>
	<itunes:summary>Shadowlessness, and how it feels.</itunes:summary>
	<itunes:keywords></itunes:keywords>
	<itunes:category text="Society &amp; Culture" />
	<itunes:author>Shadowlessness</itunes:author>
	<itunes:owner>
		<itunes:name>Shadowlessness</itunes:name>
		<itunes:email>y@yaserzt.com</itunes:email>
	</itunes:owner>
	<itunes:block>no</itunes:block>
	<itunes:explicit>no</itunes:explicit>
	<itunes:image href="http://yaserzt.com/blog/wp-content/plugins/podpress/images/powered_by_podpress_large.jpg" />
		<item>
		<title>One Less</title>
		<link>http://yaserzt.com/blog/archives/509</link>
		<comments>http://yaserzt.com/blog/archives/509#comments</comments>
		<pubDate>Sun, 22 Aug 2010 05:43:18 +0000</pubDate>
		<dc:creator>yzt</dc:creator>
				<category><![CDATA[ignore]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[stupidity]]></category>

		<guid isPermaLink="false">http://yaserzt.com/blog/?p=509</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>Where there were twenty-something, now there is one less.</p>
]]></content:encoded>
			<wfw:commentRss>http://yaserzt.com/blog/archives/509/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sorrrrrrrrrrry State of Video?</title>
		<link>http://yaserzt.com/blog/archives/505</link>
		<comments>http://yaserzt.com/blog/archives/505#comments</comments>
		<pubDate>Sun, 15 Aug 2010 06:48:38 +0000</pubDate>
		<dc:creator>yzt</dc:creator>
				<category><![CDATA[noteworthy]]></category>
		<category><![CDATA[sci-tech]]></category>

		<guid isPermaLink="false">http://yaserzt.com/blog/?p=505</guid>
		<description><![CDATA[I don&#8217;t know if I&#8217;ve written about the sorry status of digital video (in web sites and other places) before or not (I think I have, but it&#8217;s almost 11AM and I haven&#8217;t slept yet, so forgive me if I&#8217;m misremembering!) Anyways, the state of things up to a few months back was that we [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t know if I&#8217;ve written about the sorry status of digital video (in web sites and other places) before or not (I think I have, but it&#8217;s almost 11AM and I haven&#8217;t slept yet, so forgive me if I&#8217;m misremembering!)<br />
Anyways, the state of things up to a few months back was that we had quite good standards for WORM media distribution (Blurays and whatnot) but who actually uses those anymore?! If you wanted to rip video and archive them, you had a few choices.<br />
You could go with MPEG4 (Xvid) and MP3 or AC3 inside AVI, to get the best compatibility (noob-owned PCs, standalone video players, etc.) but Xvid is not the most advanced technology these days and AVI is plain obsolete; not to mention the fact that support for AVI and said codecs is <em>very</em> limited on handheld and portable devices.<br />
You could pick stupid and unwieldy containers like MP4, which might or might not be playable on this or that device. You could throw all your data down a bottomless well of Microsoft&#8217;s (or another corporation&#8217;s) fancy sounding but virtually unusable formats (codecs and containers) which I won&#8217;t even mention here.<br />
You could go with cool and quite free containers like MKV (or OGG) which are (currently) only playable on PCs (with non-noob owners!) This fact is really sad, because and MKV file with x264 and AC3 is a mighty force to be reckoned with, for storing all kinds of video, from small to UD (Ultra Definition, whenever that in invented and becomes trendy!)</p>
<p>On the web, the situation is quite simpler and more equal. <em>Everybody</em> were being fucked by Adobe Flash (and still are.) With occasional fingers thrust in by Windows Media and Apple Quicktime. All these have their own codecs (or variations of codecs) and all are proprietary. (If I had gods, I would thank them for making RealMedia defunct!)</p>
<p>But HTML5 has its own audio and video support, and HTML5 is being picked up by virtually every browser maker (yes, even Microsoft, but I can&#8217;t imagine why anybody still uses their piece of shit, except to download Firefox or Opera or Chrome or SeaMonkey or Safari. The really cool guys don&#8217;t even do that and FTP down the usable browsers directly!) The problem with HTML5 standard is that it doesn&#8217;t (didn&#8217;t?) mandate the container format and codecs (video or audio) that should be used! Obviously, this is not good for anybody. Of course, the situation could have been worse if the standard had specified a patent-laden or proprietary format, but still this under-specification means Morphy&#8217;s Law applies and web-developers and web site administrators get fucked even more than usual. Not to mention lusers.</p>
<p>A viable option for free audio and video was (and always is) of course Vorbis and Theora, and I quite like them, but people might argue that they (specially Theora) are not state-of-the-art codecs (not out-dated though, just not quite on the bleeding edge.)</p>
<p>Anyways, a few months back Google bought a company named On2 which held (presumably and hopefully) all the patents for a video codec (format) named VP8. At the time many people (including me) speculated and hoped that Google would put the patents in public domain (or whatever the term is that means make the use of the technology available to everyone, everywhere without charge and limitations for all time.) A couple of months back Google did the exact same thing and the WebM project was born. It&#8217;s defines a container format that hosts VP8 video and Vorbis audio, with no applicable patents in private control and liberal opensource-compatible licenses on all the software and libraries. Already most relevant browser makers have declared support for WebM (Mozilla, Opera, Google (obviously) and I think even Microsoft (but these days they just have to do anything the leaders of industry do, because they are not part of them anymore!)) and there are 3rd-party implementations of it. In short, I think the state of video on the web is starting to look good.</p>
<p>(This post has no links and it needs 100. I apologize for the inconvenience of having to copy+paste.)</p>
]]></content:encoded>
			<wfw:commentRss>http://yaserzt.com/blog/archives/505/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fibonacci Numbers and Bad Teachers</title>
		<link>http://yaserzt.com/blog/archives/496</link>
		<comments>http://yaserzt.com/blog/archives/496#comments</comments>
		<pubDate>Fri, 13 Aug 2010 06:36:24 +0000</pubDate>
		<dc:creator>yzt</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[rants]]></category>

		<guid isPermaLink="false">http://yaserzt.com/blog/?p=496</guid>
		<description><![CDATA[Recursion is a fascinating and essential idea in mathematics, programming and design (among other things.) As a programmer, if you don&#8217;t understand this very simple idea (and I mean really understand it) you are pretty much done for. While it&#8217;s not a hard concept for any half-intelligent person to grasp, I don&#8217;t exactly know how [...]]]></description>
			<content:encoded><![CDATA[<p>Recursion is a fascinating and essential idea in mathematics, programming and design (among other things.) As a programmer, if you don&#8217;t understand this very simple idea (and I mean <em>really</em> understand it) you are pretty much done for. While it&#8217;s not a hard concept for any half-intelligent person to grasp, I don&#8217;t exactly know how many of us really do grasp it. But it&#8217;s not what I&#8217;m going to bitch about today.</p>
<p>In programming courses, one of the first examples used to introduce the idea of recursion is the Fibonacci sequence. You know, the series of integers starting with 0 and 1, where every next number is the sum of the two previous ones. (OK, I know that you do know. I was just covering all my bases.)</p>
<p>Anyways, the most simple and elegant introductory way of implementing a function that returns the <tt>n</tt>th number in the Fibonacci series goes something like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #666666;">// Just making things clear!</span>
<span style="color: #0000ff;">typedef</span> <span style="color: #0000ff;">unsigned</span> <span style="color: #0000ff;">long</span> <span style="color: #0000ff;">long</span> Integer<span style="color: #008080;">;</span>
&nbsp;
Integer Fib <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">unsigned</span> n<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	<span style="color: #0000ff;">return</span> n <span style="color: #000080;">&lt;</span> <span style="color: #0000dd;">2</span> <span style="color: #008080;">?</span> n <span style="color: #008080;">:</span> Fib<span style="color: #008000;">&#40;</span>n <span style="color: #000040;">-</span> <span style="color: #0000dd;">2</span><span style="color: #008000;">&#41;</span> <span style="color: #000040;">+</span> Fib<span style="color: #008000;">&#40;</span>n <span style="color: #000040;">-</span> <span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>And every half-descent programmer knows that that&#8217;s probably one of the <strong>worst</strong> ways you can implement the idea. I&#8217;m not kidding. The teachers just throw this at the students, and the brighter of the students see the elegance and simple beauty of it and it will take years for most of them to realize the problems with this particular implementation. Some of them never do. This implementation performs <em>very</em> poorly for even the small values of <tt>n</tt>, which of course should be apparent when you contemplate its time complexity and recursion tree (I won&#8217;t go into space considerations, because they are not much of a problem until <tt>n</tt> goes into (many) thousands, at which point the value of the function becomes larger than you can store naively in most languages, which means you should have already given space considerations a serious thought.)</p>
<p>But even later, when the students learn about complexity analysis and Big O notation and crap like that, more often than not, they fail to apply the newly acquired knowledge to the old beliefs. If the teacher is good, and the student is bright and lucky enough, they walk out of their algorithm and data structure course with the new belief that bubble sort is bad, hash tables are good, and disk seek times dominate everything else (all of which are obviously bullshit in the absolute sense.)</p>
<p>For the more astute reader, I need to clarify that the badness of the mentioned implementation stems from the fact that most common languages (including C++) are mainly <em>side-effect-driven</em> languages, in that they rely mostly on the side-effects of expressions and statements to get the intended job done (the usage of the term &#8220;statement&#8221; is a clear sign of that.) Otherwise, you wouldn&#8217;t see so much assignment in our code. A functional and side-effect-free programming language (or more accurately, programming model) could easily cache the result of each invocation of the <tt>Fib</tt> function for any particular <tt>n</tt> (because the function call would be without side effects and therefore time-invariant) and would not need to evaluate any <tt>Fib(n)</tt> more than once. This is something that is being done in some of the better implementations of functional languages, AFAIK.</p>
<p>To emulate this behavior in this case, one can use a hand-coded version of what is known as <em><a href="http://en.wikipedia.org/wiki/Memoization">Memoization</a></em>, a la:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="cpp" style="font-family:monospace;">Integer Fib <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">unsigned</span> n<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	<span style="color: #0000ff;">static</span> std<span style="color: #008080;">::</span><span style="color: #007788;">vector</span><span style="color: #000080;">&lt;</span>Integer<span style="color: #000080;">&gt;</span> Mem<span style="color: #008080;">;</span>
	<span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>n <span style="color: #000080;">&lt;</span> Mem.<span style="color: #007788;">size</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #000040;">&amp;&amp;</span> <span style="color: #0000dd;">0</span> <span style="color: #000040;">!</span><span style="color: #000080;">=</span> Mem<span style="color: #008000;">&#91;</span>n<span style="color: #008000;">&#93;</span><span style="color: #008000;">&#41;</span> <span style="color: #0000ff;">return</span> Mem<span style="color: #008000;">&#91;</span>n<span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span>  <span style="color: #666666;">// The second condition is redundant, right?</span>
&nbsp;
	Integer ret <span style="color: #000080;">=</span> n <span style="color: #000080;">&lt;</span> <span style="color: #0000dd;">2</span> <span style="color: #008080;">?</span> n <span style="color: #008080;">:</span> Fib<span style="color: #008000;">&#40;</span>n <span style="color: #000040;">-</span> <span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span> <span style="color: #000040;">+</span> Fib<span style="color: #008000;">&#40;</span>n <span style="color: #000040;">-</span> <span style="color: #0000dd;">2</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
	<span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>n <span style="color: #000080;">&gt;=</span> Mem.<span style="color: #007788;">size</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span> Mem.<span style="color: #007788;">resize</span> <span style="color: #008000;">&#40;</span>n <span style="color: #000040;">+</span> <span style="color: #0000dd;">1</span>, <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
	Mem<span style="color: #008000;">&#91;</span>n<span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> ret<span style="color: #008080;">;</span>
&nbsp;
	<span style="color: #0000ff;">return</span> ret<span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>This is not a bad implementation. It does have some issues in multithreaded applications, but I&#8217;m willing to overlook that for now. This implementation is linear in both time and space, and it can be faster than simple non-recursive implementations because it never calculates any <tt>Fib(n)</tt> more than once over the whole lifetime of the process. But it&#8217;s not pretty (it has its charms, though!) and this way of doing things is error-prone (because you are adding memory and bookkeeping to a mathematical construct that is otherwise free of this stuff.) Not to mention that it is basically impossible to use as an introductory example; because it needs knowledge from all over the map.</p>
<p>A better implementation might be:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="cpp" style="font-family:monospace;">std<span style="color: #008080;">::</span><span style="color: #007788;">pair</span><span style="color: #000080;">&lt;</span>Integer, Integer<span style="color: #000080;">&gt;</span> _fib <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">unsigned</span> n<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	<span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>n <span style="color: #000080;">&lt;</span> <span style="color: #0000dd;">2</span><span style="color: #008000;">&#41;</span> <span style="color: #0000ff;">return</span> std<span style="color: #008080;">::</span><span style="color: #007788;">make_pair</span><span style="color: #008000;">&#40;</span>n, <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
	std<span style="color: #008080;">::</span><span style="color: #007788;">pair</span><span style="color: #000080;">&lt;</span>Integer, Integer<span style="color: #000080;">&gt;</span> Fn_1 <span style="color: #000080;">=</span> _fib<span style="color: #008000;">&#40;</span>n <span style="color: #000040;">-</span> <span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
	<span style="color: #0000ff;">return</span> std<span style="color: #008080;">::</span><span style="color: #007788;">make_pair</span><span style="color: #008000;">&#40;</span>Fn_1.<span style="color: #007788;">first</span> <span style="color: #000040;">+</span> Fn_1.<span style="color: #007788;">second</span>, Fn_1.<span style="color: #007788;">first</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
Integer Fib <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">unsigned</span> n<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	<span style="color: #0000ff;">return</span> _fib<span style="color: #008000;">&#40;</span>n<span style="color: #008000;">&#41;</span>.<span style="color: #007788;">first</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>Of course, the meat of this implementation (such as it is) is the <tt>_fib</tt> function. The other one is just there to present a nicer and more consistent interface. Let me be the first one to say that there are more ways to implement a better Fibonacci and still stay essentially recursive. This is just one way, and not a particularly great one. But it&#8217;s not bad either.</p>
<p>Now, how come no programming instructor ever teaches the likes of this implementation? Not the ones I studied under, at least. Are they afraid that their students&#8217; heads are going to explode? PROGRAMMING IS HARD PEOPLE! If a programmer can&#8217;t handle a substantial improvement over a bad implementation of a simple idea, they are in for a big (and not at all nice) surprise. I hereby beg any teachers, instructors, professors and whatnot that have anything to do with teaching starting programmers to quit treating them like idiots, because idiots won&#8217;t make good programmers. The idiots are not going to understand what they need anyways, so why take the chance of profound understanding from those who have the capacity to learn, but might not if you treat them like babies?</p>
<p>For the sake of completeness, here&#8217;s a non-recursive implementation:</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
</pre></td><td class="code"><pre class="cpp" style="font-family:monospace;">Integer Fib <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">unsigned</span> n<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	<span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #0000dd;">0</span> <span style="color: #000080;">==</span> n<span style="color: #008000;">&#41;</span> <span style="color: #0000ff;">return</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
&nbsp;
	Integer last <span style="color: #000080;">=</span> <span style="color: #0000dd;">1</span>, penultimate <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
	<span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">unsigned</span> i <span style="color: #000080;">=</span> <span style="color: #0000dd;">1</span><span style="color: #008080;">;</span> i <span style="color: #000080;">&lt;</span> n<span style="color: #008080;">;</span> <span style="color: #000040;">++</span>i<span style="color: #008000;">&#41;</span>
	<span style="color: #008000;">&#123;</span>
		penultimate <span style="color: #000040;">+</span><span style="color: #000080;">=</span> last<span style="color: #008080;">;</span>
		std<span style="color: #008080;">::</span><span style="color: #007788;">swap</span> <span style="color: #008000;">&#40;</span>last, penultimate<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
	<span style="color: #008000;">&#125;</span>
&nbsp;
	<span style="color: #0000ff;">return</span> last<span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>This is the fastest of implementations offered here, with the exception of the memoizing one (and only in amortized sense.) But nothing prevents us from applying the memoization technique to an iterative implementation as well, albeit not in a general and automatic way. It might not be apparent or significant in such a simple sample, but for some class of problems, recursive solutions are usually easier to devise and understand, and therefore easier to get right. In any case, nothing is clear-cut when it comes to programming, and I&#8217;m almost offended when people (specially people who should know better) behave as if almost everything is.</p>
]]></content:encoded>
			<wfw:commentRss>http://yaserzt.com/blog/archives/496/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Theme Change and Getting Unanalytical</title>
		<link>http://yaserzt.com/blog/archives/494</link>
		<comments>http://yaserzt.com/blog/archives/494#comments</comments>
		<pubDate>Mon, 02 Aug 2010 05:29:27 +0000</pubDate>
		<dc:creator>yzt</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://yaserzt.com/blog/?p=494</guid>
		<description><![CDATA[I have changed the theme of my blog (as you can see, unless you are syndicating) from Barthelme to something called Fluid Blue. It was mostly out of boredom, and I&#8217;m not sure about the result yet. In other news, I have decided to drop Google Analytics usage on my blog; mostly as a statement [...]]]></description>
			<content:encoded><![CDATA[<p>I have changed the theme of my blog (as you can see, unless you are syndicating) from Barthelme to something called Fluid Blue. It was mostly out of boredom, and I&#8217;m not sure about the result yet.</p>
<p>In other news, I have decided to drop Google Analytics usage on my blog; mostly as a statement in support of privacy activism. I really like Google, and most of the time they do the Right Thing, so I&#8217;m not really worried about them stockpiling and misusing our data. However, why should you guys (my less-than-a-handful of readers) trust Google with your data for my benefit?! That&#8217;s certainly an attitude I want other people to have toward me, so I&#8217;m gonna start from myself and scrap Google Analytics and I don&#8217;t think I would use any kind of 3rd-party user tracking system unless their handling and storage of the data is completely and provably secure, anonymous and temporary.</p>
<p>An obvious side effect of this is that I can no longer know how many people are reading my blog. I&#8217;d appreciate if you guys (I know there are at least two, so my sentence is syntactically and semantically correct) would be more active, comment-wise!</p>
]]></content:encoded>
			<wfw:commentRss>http://yaserzt.com/blog/archives/494/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>An ABSOLUTELY Unmissable Talk on Modern Hardware</title>
		<link>http://yaserzt.com/blog/archives/486</link>
		<comments>http://yaserzt.com/blog/archives/486#comments</comments>
		<pubDate>Tue, 27 Jul 2010 02:21:13 +0000</pubDate>
		<dc:creator>yzt</dc:creator>
				<category><![CDATA[cool]]></category>
		<category><![CDATA[game development]]></category>
		<category><![CDATA[noteworthy]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[sci-tech]]></category>

		<guid isPermaLink="false">http://yaserzt.com/blog/?p=486</guid>
		<description><![CDATA[Iff[sic] you are a programmer, if you don&#8217;t do anything else even if you don&#8217;t eat and even if you don&#8217;t shower, please please please please please watch this presentation. The presenter is Dr. Cliff Click, and the topic is an in-depth view of modern code execution architecture. The talk is from 2009, and it [...]]]></description>
			<content:encoded><![CDATA[<p>Iff[sic] you are a programmer, if you don&#8217;t do anything else even if you don&#8217;t eat and even if you don&#8217;t shower, please please please please <a href="http://www.infoq.com/presentations/click-crash-course-modern-hardware">please watch this presentation</a>.</p>
<p>The presenter is Dr. Cliff Click, and the topic is an in-depth view of modern code execution architecture. The talk is from 2009, and it has been on my to{do} list for almost 6 months. It is the best thing I have seen in the last year (and I played God of War III!) if not in many years. The guy is obviously very knowledgeable and he talks extremely fast, which just means that he packs an incredible amount of invaluable information into this 50+ minute talk.</p>
<p>I can&#8217;t stress this enough. Take an hour to watch this. Please! If you are a game developer, or any programmer with a conscience, you have to watch it right now! I&#8217;m not kidding here. Watch this through.</p>
<p>On an ego-boosting note, I just watched this talk and I already knew almost all of it (I have to brush up on the newer cache-coherency protocols though; those have also been on my to{do} list for some time now!) It did have some eye-opening &#8220;Aha!&#8221; moments for me. I may write about them later.</p>
<p>What are you doing still reading my shithead rant?! GO WATCH THIS!<a href='http://yaserzt.com/files/09-sep-JVMperformance.flv' >Cliff Click&#8217;s Crash Course in Modern Hardware (hosted locally.)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://yaserzt.com/blog/archives/486/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
			<enclosure url="http://yaserzt.com/files/09-sep-JVMperformance.flv" length="102983344" type="video/x-flv" />
	</item>
		<item>
		<title>.NET and I</title>
		<link>http://yaserzt.com/blog/archives/484</link>
		<comments>http://yaserzt.com/blog/archives/484#comments</comments>
		<pubDate>Tue, 27 Jul 2010 00:54:25 +0000</pubDate>
		<dc:creator>yzt</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[rants]]></category>
		<category><![CDATA[stupidity]]></category>

		<guid isPermaLink="false">http://yaserzt.com/blog/?p=484</guid>
		<description><![CDATA[I learned C# in 2000, when the compiler and tools were still in beta (I think. I know I was working with the beta, but maybe the finals were released unbeknownst to me (hehehe! The Firefox spellchecker does not recognize &#8220;unbeknownst&#8221;!)) I remember that I liked the language. It was clean and relatively compact, it [...]]]></description>
			<content:encoded><![CDATA[<p>I learned C# in 2000, when the compiler and tools were still in beta (I think. I know I was working with the beta, but maybe the finals were released unbeknownst to me (hehehe! The Firefox spellchecker does not recognize &#8220;unbeknownst&#8221;!))</p>
<p>I remember that I liked the language. It was clean and relatively compact, it had a largish and useful library, it was like C++ and Java (benefit? really?) and it had a command-line compiler. My impression at the time was that it was more suitable for small and quick programs, and very suitable for teaching programming. I even suggested it to my teachers at university as a replacement for Pascal, which was then thought as the first language to CE students (this was maybe 4 years before I met Lisp, or better yet, Python.) This was also before the whole .NET fucked-up-ness happened with all the WinForms and ASP.NET and whatever other shit they are peddling these days. In those days, .NET and C# produced console applications, unless you ventured into the river of diarrhea output that is the Win32 GUI API; but that was pretty much what you generally had, back then.</p>
<p>Anyways, my shallow and brief delving into the world of .NET was barely deep enough for me to familiarize myself with the inner workings of MSIL and the JIT compiler and the virtual machine. I learned little about these, and I have not kept up with the new developments in .NET, and I have no regrets there. I generally hate GUIs and network technologies that aim to solve all problems on all levels for everybody. They may suit some, and I have absolutely no doubt that many .NET-based applications wouldn&#8217;t have been as easy-to-write for other libraries and runtimes<sup><a id="backref-footnote-01" href="#footnote-01">1</a></sup>. But I don&#8217;t generally like .NET and this opinion (I suspect) would be very hard to change.</p>
<p>The most obvious reason for this obvious dislike is the one I mentioned above. .NET is the champion of the all-for-all thoughtcrime. More than anything else that I have seen, it tries to do all for everyone and everything; without giving them an inkling of what the hell is really going on on any level below the most superficial. This may suit some, but it shouldn&#8217;t.</p>
<p>I seriously believe that every programmer needs to know what&#8217;s going on under the hood. Total abstractions almost never work beyond the most simple and trivial cases<sup><a id="backref-footnote-02" href="#footnote-02">2</a></sup>. If you don&#8217;t know jackshit about your platform and your programs seem to have worked so far, you are just <em>lucky</em>. Let me give you an analogy. If you don&#8217;t know anything about how cars work and you drive one, when your cars breaks down in the middle of nowhere and you have no means of communication, the you are royally fucked. The fact that this has not happened so far, it just means that the Random Number Gods have smiled upon you so far. It may never happen, but it just as well might. That&#8217;s the way it is with programming. Except that the level of quality discrepancies among software and hardware products that you use is <em>much</em> wider.</p>
<p>All programming languages abstract the platform in some form and manner. But as some languages hide not much and what they hide, they do with much shame and much apologies (Assembly, C, etc.) others do as much as they can to distance you from the hardware. They even boast this feature!</p>
<p>In short, every good programmer that I know and I know of knows the whole stack of software and hardware underneath <em>deeply</em> and <em>intimately</em>. In fact, it might even be true that the better they know this mess, the better they are<sup><a id="backref-footnote-03" href="#footnote-03">3</a></sup>.</p>
<p>Let me conclude now. I am not saying that technologies like .NET and Java and all those &#8220;high-level&#8221; languages are useless. I&#8217;m just saying they make it harder to be conscious about the actual platform and the rest that lies under your code. I&#8217;m pretty certain that the best .NET programmers can pretty much generate the MSIL code and the machine code that their compiler and the JIT compiler generate for any given part of their code. Maybe you should too.</p>
<hr />
<small></p>
<p id="footnote-01"><a href="#backref-footnote-01">1:</a> Note that I don&#8217;t use the word &#8220;platform&#8221; here, and any other use of the word for a software technology in unintentional and a result of the force of (a bad) habit. No software is a platform; hardware is. It&#8217;s always the hardware that runs the code, and the hardware is always the platform. If you think otherwise, I believe you are the subject of the same kind of conditioning that has affected most of us.</p>
<p id="footnote-02"><a href="#backref-footnote-02">2:</a> Read <a href="http://www.joelonsoftware.com/articles/LeakyAbstractions.html">this post</a> on Joel Spolsky&#8217;s great (yet now sadly dormant) blog for the original presentation of the Law of Leaky Abstractions. Also read the <a href="http://en.wikipedia.org/wiki/Leaky_abstraction">Wikipedia page</a> (and then the <a href="http://en.wikipedia.org/wiki/Talk:Leaky_abstraction">talk page</a> for an interesting discussion.) Also read <a href="http://www.codinghorror.com/blog/2009/06/all-abstractions-are-failed-abstractions.html">this Coding Horror post</a> for a hilarious (well, not really!) example. Fuck LINQ!</p>
<p id="footnote-03"><a href="#backref-footnote-03">3:</a> I don&#8217;t believe that it&#8217;s this knowledge that they acquired first and it magically made them good programmers. I think on the way of becoming good, they had to acquire this knowledge. I have to ponder this a bit more.</p>
<p></small></p>
]]></content:encoded>
			<wfw:commentRss>http://yaserzt.com/blog/archives/484/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>There Should Be Dancing Around a Bonfire!</title>
		<link>http://yaserzt.com/blog/archives/478</link>
		<comments>http://yaserzt.com/blog/archives/478#comments</comments>
		<pubDate>Sun, 11 Jul 2010 00:06:43 +0000</pubDate>
		<dc:creator>yzt</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[rants]]></category>

		<guid isPermaLink="false">http://yaserzt.com/blog/?p=478</guid>
		<description><![CDATA[This should be no news to anybody who has anything to do with writing and distributing C/C++ applications on Windows, but Microsoft has finally decided to drop the fucking SxS shit for Visual C++ 2010 CRT and go back to the sweet old days of plain, distributed-alongside-your-application DLL files! (Read here if you don&#8217;t believe [...]]]></description>
			<content:encoded><![CDATA[<p>This should be no news to anybody who has anything to do with writing and distributing C/C++ applications on Windows, but Microsoft has finally decided to drop the fucking SxS shit for Visual C++ 2010 CRT and go back to the sweet old days of plain, distributed-alongside-your-application DLL files! (<a href="http://msdn.microsoft.com/en-us/library/dd293574(VS.100).aspx">Read here if you don&#8217;t believe me!</a> I don&#8217;t know how far one can trust MSDN and how long that link will stay valid (I mean, how hard is that?! Keep your stupid fucking links valid, you idiot douche bags!) but there it is for now, and I have verified it on VC2010 RTM.)</p>
<p>How fucking twisted is that?! I&#8217;m actually rejoicing because we are going back to DLL Hell! But after experiencing the abyss of WinSxS Hell, I would happily crawl back to the open and only mildly tormenting depths of the good old DLL Hell. This means that I will (hopefully!) never ever have to mess around with ass-busting manifests and colossally subtle version conflicts and hunting down every single gods-damned version of every single fucking-gods-damned CRT component that might or might not have been subject to some whimsical patch by the morons at Microsoft in the past year, in one or other version of Windows. This means that I will just distribute the fucking version of the CRT that seems to barely work <em>alongside</em> my applications (that is, in the same directory) and it will probably (say 30% instead of 1e-10%) work, and no one will be able to override their usage behind the poor hapless user&#8217;s back (using conventional methods; that is. Everybody knows how easy it is to hijack a function call into a DLL in Windows; which I have to say is not necessarily a bad thing.)</p>
<p>And don&#8217;t anyone dare ask me why I link to CRT as a DLL in the first place, instead of a statically linked LIB!</p>
<p>P.S. I have decided to write as I think (regarding the usage of curse words.) So no more <em>frak</em>s and <em>friggin</em>s and <em>butt</em>s and <em>backside</em>s. Deal with it.</p>
]]></content:encoded>
			<wfw:commentRss>http://yaserzt.com/blog/archives/478/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A New Blog of Note!</title>
		<link>http://yaserzt.com/blog/archives/474</link>
		<comments>http://yaserzt.com/blog/archives/474#comments</comments>
		<pubDate>Sun, 20 Jun 2010 22:58:59 +0000</pubDate>
		<dc:creator>yzt</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[cool]]></category>
		<category><![CDATA[noteworthy]]></category>

		<guid isPermaLink="false">http://yaserzt.com/blog/?p=474</guid>
		<description><![CDATA[I found this person who was looking for a place to put up a blog. I gave that person space and here is the result. In my opinion, it is definitely worth a read. It contains mostly scraps of fiction with a theme of fantasy, some dark poetry and the like. You know how the [...]]]></description>
			<content:encoded><![CDATA[<p>I found this person who was looking for a place to put up a blog. I gave that person space and <a href="http://azath.yaserzt.com/">here is the result</a>. In my opinion, it is definitely worth a read. It contains mostly scraps of fiction with a theme of fantasy, some dark poetry and the like.<br />
You know how the world is for a new blogger! Go and have a look, and leave a comment or two even if it is a one liner. Encourage the blogger if you like it at all.</p>
]]></content:encoded>
			<wfw:commentRss>http://yaserzt.com/blog/archives/474/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Miracle of Flaming Hand</title>
		<link>http://yaserzt.com/blog/archives/470</link>
		<comments>http://yaserzt.com/blog/archives/470#comments</comments>
		<pubDate>Mon, 24 May 2010 22:38:27 +0000</pubDate>
		<dc:creator>yzt</dc:creator>
				<category><![CDATA[cool]]></category>
		<category><![CDATA[hilarious]]></category>
		<category><![CDATA[ignore]]></category>
		<category><![CDATA[stupidity]]></category>

		<guid isPermaLink="false">http://yaserzt.com/blog/?p=470</guid>
		<description><![CDATA[I saw my left hand burning tonight. It was engulfed in blue and yellowish flames of naphtha. I would have watched and enjoyed the sight much more if my right hand hadn&#8217;t been aflame before with my Zippo in it and I hadn&#8217;t thrown it into a glass of water! You see kids, there is [...]]]></description>
			<content:encoded><![CDATA[<p>I saw my left hand burning tonight. It was engulfed in blue and yellowish flames of naphtha. I would have watched and enjoyed the sight much more if my right hand hadn&#8217;t been aflame before with my Zippo in it and I hadn&#8217;t thrown it into a glass of water!<br />
You see kids, there is actually no way of putting out a Zippo if it&#8217;s out of the case, say for refueling. I would really have liked to stop and take a picture for demonstration purposes, but saving a drowning Zippo is much more important.</p>
]]></content:encoded>
			<wfw:commentRss>http://yaserzt.com/blog/archives/470/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>&#8220;3D Modeling for Games&#8221; Educational Challenge</title>
		<link>http://yaserzt.com/blog/archives/468</link>
		<comments>http://yaserzt.com/blog/archives/468#comments</comments>
		<pubDate>Wed, 12 May 2010 21:00:55 +0000</pubDate>
		<dc:creator>yzt</dc:creator>
				<category><![CDATA[cool]]></category>
		<category><![CDATA[noteworthy]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://yaserzt.com/blog/?p=468</guid>
		<description><![CDATA[Fanafzar Game Studios, the company I work for and the makers of Garshasp with the help of CGArt.ir society and several notable others are orchestrating a 3D modeling competition for aspiring and experienced game artists. You can read every thing about it over here. The reason&#8217;s for holding such an event is at least three-fold. [...]]]></description>
			<content:encoded><![CDATA[<p>Fanafzar Game Studios, the company I work for and the makers of <a href="http://garshasp.com/">Garshasp</a> with the help of <a href="http://cgart.ir/">CGArt.ir society</a> and several <a href="http://www.rooz3d.com/">notable</a> <a href="http://www.robhruppel.com/">others</a> are orchestrating a 3D modeling competition for aspiring and experienced game artists. <strong>You can read every thing about it <a href="http://www.cgjobs.ir/events/3dmodelingforgame/">over here</a>.</strong></p>
<p>The reason&#8217;s for holding such an event is at least three-fold. First is to show how many talented artist live and work in Iran. Second is to get them into a challenge that will benefit all of them as they work towards a common goal with each other. The third one is to find a few really talented and driven modelers and persuade them to come and work with us on our upcoming projects!</p>
<p>Oh, I forgot to say that the first prize is a PS3 bundled with Uncharted 2: Among Thieves! (I wish I was a 3D artist! No one gives such prizes to game programmers!)</p>
<p>So, even if you are not interested yourselves, please spread the word around.</p>
]]></content:encoded>
			<wfw:commentRss>http://yaserzt.com/blog/archives/468/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>James Randi</title>
		<link>http://yaserzt.com/blog/archives/466</link>
		<comments>http://yaserzt.com/blog/archives/466#comments</comments>
		<pubDate>Tue, 11 May 2010 18:54:36 +0000</pubDate>
		<dc:creator>yzt</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[noteworthy]]></category>
		<category><![CDATA[stupidity]]></category>

		<guid isPermaLink="false">http://yaserzt.com/blog/?p=466</guid>
		<description><![CDATA[http://adeli.ir/blog/?p=122]]></description>
			<content:encoded><![CDATA[<p>http://adeli.ir/blog/?p=122</p>
]]></content:encoded>
			<wfw:commentRss>http://yaserzt.com/blog/archives/466/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Lesson in &#8220;Test&#8221; Attitude</title>
		<link>http://yaserzt.com/blog/archives/464</link>
		<comments>http://yaserzt.com/blog/archives/464#comments</comments>
		<pubDate>Thu, 29 Apr 2010 21:25:02 +0000</pubDate>
		<dc:creator>yzt</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[cool]]></category>
		<category><![CDATA[noteworthy]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://yaserzt.com/blog/?p=464</guid>
		<description><![CDATA[Back in the old days of the net, even before I was born, people did implement TCP/IP stacks. And since there weren&#8217;t much of a solid and standard specification (not to mentions decades of engineering experience in implementation and maintenance of network stacks,) these implementations tended to be buggy, unstable and non-conforming. To test these [...]]]></description>
			<content:encoded><![CDATA[<p>Back in the old days of the net, even before I was born, people did implement TCP/IP stacks. And since there weren&#8217;t much of a solid and standard specification (not to mentions decades of engineering experience in implementation and maintenance of network stacks,) these implementations tended to be buggy, unstable and non-conforming. To test these various TCP/IP implementations (such as they were,) people used to come together and just test them against each other and compare their functions. These sessions and discussions and reviews were called &#8220;TCP and IP bake offs&#8221;. It has been said that as a result of these discussions, the specifications were as likely to change as the implementations!</p>
<p>These dudes pretty much built the whole frakking Internet without the bureaucracy and the 3000-page conformance guidelines and the 2-million line test suit or the 12 years worth of committee meetings. Their procedures, and much more importantly their attitudes is quite concisely demonstrated in <a href="http://www.faqs.org/rfcs/rfc1025.html">RFC 1025</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://yaserzt.com/blog/archives/464/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dishwasher: Dead and Smiling!</title>
		<link>http://yaserzt.com/blog/archives/460</link>
		<comments>http://yaserzt.com/blog/archives/460#comments</comments>
		<pubDate>Sun, 18 Apr 2010 13:52:16 +0000</pubDate>
		<dc:creator>yzt</dc:creator>
				<category><![CDATA[Poetry]]></category>
		<category><![CDATA[Quotes]]></category>
		<category><![CDATA[entertainment]]></category>

		<guid isPermaLink="false">http://yaserzt.com/blog/?p=460</guid>
		<description><![CDATA[I had a perfect nightmare on a starry torrid sea: I am cast to prison at a crippled demon&#8217;s plea. The demon has 3 faces all are laughing down at me. The Banker with his filthy lucre sets the game astride. The General with raging might lets forth a battle cry. The Judge locks now [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>I had a perfect nightmare<br />
on a starry torrid sea:</p>
<p>I am cast to prison at a<br />
crippled demon&#8217;s plea.</p>
<p>The demon has 3 faces<br />
all are laughing down at me.</p>
<p>The Banker with his filthy lucre<br />
sets the game astride.</p>
<p>The General with raging might<br />
lets forth a battle cry.</p>
<p>The Judge locks now the metal<br />
tomb where I&#8217;m meant to die.</p>
<p>&#8230; But vengeance is<br />
a brutal beast<br />
not held by any cell</p>
<p>My wit is steeled<br />
My blade is wet<br />
So sound the Reaper&#8217;s bell.</p>
<p>Banker, General and Judge!<br />
You all shall burn in Hell.</p></blockquote>
<blockquote><p>&#8211; From <strong>The Dishwasher: Vampire Smile</strong>&#8216;s <a href="http://www.gametrailers.com/video/debut-trailer-dishwasher-vampire/62317">debut trailer</a>.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://yaserzt.com/blog/archives/460/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Piggybacking On Some Hapless Loser&#8217;s Wireless</title>
		<link>http://yaserzt.com/blog/archives/459</link>
		<comments>http://yaserzt.com/blog/archives/459#comments</comments>
		<pubDate>Fri, 16 Apr 2010 11:58:49 +0000</pubDate>
		<dc:creator>yzt</dc:creator>
				<category><![CDATA[cool]]></category>
		<category><![CDATA[ignore]]></category>

		<guid isPermaLink="false">http://yaserzt.com/blog/2010/04/16/piggybacking-on-some-hapless-losers-wireless/</guid>
		<description><![CDATA[and with my cellphone, no less! \m/]]></description>
			<content:encoded><![CDATA[<p>and with my cellphone, no less! \m/</p>
]]></content:encoded>
			<wfw:commentRss>http://yaserzt.com/blog/archives/459/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;Planning for Debugging Day&#8221; Presentation</title>
		<link>http://yaserzt.com/blog/archives/454</link>
		<comments>http://yaserzt.com/blog/archives/454#comments</comments>
		<pubDate>Tue, 13 Apr 2010 13:32:49 +0000</pubDate>
		<dc:creator>yzt</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[game development]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[sci-tech]]></category>

		<guid isPermaLink="false">http://yaserzt.com/blog/?p=454</guid>
		<description><![CDATA[Here are my presentation slides from the talk I gave this past March in Sharif University, at the first Iranian computer game developer&#8217;s mini-conference. Here I talk (mostly out of personal experience) about things that we should pay attention to, at the beginning of a game development project, so our debugging and issue tracking and [...]]]></description>
			<content:encoded><![CDATA[<p>Here are my <a href='http://yaserzt.com/blog/wp-content/uploads/2010/04/CGS10-yzt-PlanningForDebuggingDay-rev05.pdf'>presentation slides</a> from the talk I gave this past March in Sharif University, at the first Iranian computer game developer&#8217;s mini-conference.</p>
<p>Here I talk (mostly out of personal experience) about things that we should pay attention to, at the beginning of a game development project, so our debugging and issue tracking and solving experience becomes less irritating and more effective. I&#8217;d be happy to hear any suggestions, corrections and discussions.</p>
<p>Oh, and I have expanded the talk a bit, from what I actually presented! Also I&#8217;d be happy to explain my views on any of the particular points if anyone actually bothers to read through the thing.</p>
]]></content:encoded>
			<wfw:commentRss>http://yaserzt.com/blog/archives/454/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>National Computer Games Conference</title>
		<link>http://yaserzt.com/blog/archives/452</link>
		<comments>http://yaserzt.com/blog/archives/452#comments</comments>
		<pubDate>Tue, 09 Mar 2010 01:45:34 +0000</pubDate>
		<dc:creator>yzt</dc:creator>
				<category><![CDATA[game development]]></category>
		<category><![CDATA[noteworthy]]></category>

		<guid isPermaLink="false">http://yaserzt.com/blog/?p=452</guid>
		<description><![CDATA[Sharif University is holding a two-day conference on games and game development. We (the guys at Fanafzar) are going to attend and some of us are going to have presentations and panels. There are also other interesting talks, mostly on the lighter side of technical issues. Here&#8217;s the web page for the conference, and here&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Sharif University is holding a two-day conference on games and game development. We (the guys at Fanafzar) are going to attend and some of us are going to have presentations and panels. There are also other interesting talks, mostly on the lighter side of technical issues. <a href="http://cgs.sharif.ir/home">Here&#8217;s the web page</a> for the conference, and here&#8217;s the <a href="http://cgs.sharif.ir/register">pre-registration page</a> (but I think you need to actually show up there on the first morning to register.)</p>
<p>The conference will be held on Esfand 19th and 20th (March 10th and 11th) somewhere inside SUT campus (yes, that&#8217;s tomorrow!)</p>
<p>My talk&#8217;s title is &#8220;Planning for Debugging Day&#8221; and in it I will present some thoughts and topics you should ponder and consider at the beginning of a game project to have less problems later on in the cycle when debugging, adding features, releasing, etc.</p>
]]></content:encoded>
			<wfw:commentRss>http://yaserzt.com/blog/archives/452/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Smith, the Ascendant</title>
		<link>http://yaserzt.com/blog/archives/450</link>
		<comments>http://yaserzt.com/blog/archives/450#comments</comments>
		<pubDate>Sat, 06 Mar 2010 15:31:39 +0000</pubDate>
		<dc:creator>yzt</dc:creator>
				<category><![CDATA[entertainment]]></category>
		<category><![CDATA[hilarious]]></category>
		<category><![CDATA[ignore]]></category>
		<category><![CDATA[rants]]></category>

		<guid isPermaLink="false">http://yaserzt.com/blog/?p=450</guid>
		<description><![CDATA[&#8220;Oh God!&#8221; &#8220;Smith will suffice.&#8221;]]></description>
			<content:encoded><![CDATA[<blockquote><p>&#8220;Oh God!&#8221;<br />
&#8220;Smith will suffice.&#8221;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://yaserzt.com/blog/archives/450/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tread Softly, Johnny Walker!</title>
		<link>http://yaserzt.com/blog/archives/446</link>
		<comments>http://yaserzt.com/blog/archives/446#comments</comments>
		<pubDate>Fri, 15 Jan 2010 21:02:32 +0000</pubDate>
		<dc:creator>yzt</dc:creator>
				<category><![CDATA[ignore]]></category>
		<category><![CDATA[life]]></category>

		<guid isPermaLink="false">http://yaserzt.com/blog/?p=446</guid>
		<description><![CDATA[Had I the heavens&#8217; embroidered cloths, Enwrought with golden and silver light, The blue and the dim and the dark cloths Of night and light and the half-light, I would spread the cloths under your feet: But I, being poor, have only my dreams; I have spread my dreams under your feet, Tread softly because [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>Had I the heavens&#8217; embroidered cloths,<br />
Enwrought with golden and silver light,<br />
The blue and the dim and the dark cloths<br />
Of night and light and the half-light,<br />
I would spread the cloths under your feet:<br />
But I, being poor, have only my dreams;<br />
I have spread my dreams under your feet,<br />
<strong>Tread softly because you tread on my dreams.</strong></p></blockquote>
<p>This, of course, applies specially to the &#8220;Black Label&#8221;. However, only those who know what I&#8217;m talking about can possibly know what I&#8217;m talking about! <img src='http://yaserzt.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://yaserzt.com/blog/archives/446/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Problem</title>
		<link>http://yaserzt.com/blog/archives/444</link>
		<comments>http://yaserzt.com/blog/archives/444#comments</comments>
		<pubDate>Mon, 11 Jan 2010 09:31:49 +0000</pubDate>
		<dc:creator>yzt</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[rants]]></category>
		<category><![CDATA[stupidity]]></category>

		<guid isPermaLink="false">http://yaserzt.com/blog/?p=444</guid>
		<description><![CDATA[Religion is harmful. Throughout history so much conflict, war and misery has been caused by organized religion that religious people hardly even see it. They probably attribute it to human nature, or &#8220;other religions.&#8221; I believe, and I think people would agree if they think about it, that religion has been the most effective and [...]]]></description>
			<content:encoded><![CDATA[<p>Religion is harmful. Throughout history so much conflict, war and misery has been caused by organized religion that religious people hardly even see it. They probably attribute it to human nature, or &#8220;other religions.&#8221;<br />
I believe, and I think people would agree if they think about it, that religion has been the most effective and most used tool for mass conditioning and mass brain-washing. It has always brought an illogical imbalance to societies and has caused endless strife and animosity within them.<br />
I&#8217;m not talking here about the wrongness of the concept of religion. All religion is bullshit, and all religion that divides people based on any criteria (believers and non-believers, sinners and saints, etc.) is harmful and must be treated as a disease of mind, but I&#8217;m not here to try to prove what seems to be obvious if you forget your childhood upbringing and conditioning. What I&#8217;m talking about is the danger and destructive effect of systematic, organized and political religion.</p>
<p>You look at human history, and almost every time there has been a war or oppression or genocide, it has had its roots in religion, in one way or the other. But, you might object, religion has brought happiness and peace of mind to billions. Well, while the extent of the happiness and the number of people affected by it is debatable, it can&#8217;t be denied that religious beliefs have been beneficial to many. But so has been the cartoons made by Disney! Have they not brought joy and happiness to hundreds of millions or perhaps billions, too? And there hasn&#8217;t been any wars or mass murders or tortures caused by a Walt Disney film. We must start analyzing the benefit/harm ratio of religions rationally.</p>
<p>So for some reason, among all the works of fiction it has been religion and religious materials that have gained special attention and have been given special status. Why? I don&#8217;t know. Maybe they have had more time with our collective brains to turn them into mush and turn us into brainless zombies. Maybe if you think about religion in terms of the theory of memes, it will become apparent that <em>everything</em> about a religion, specially the more widespread ones, is evolved with one most important purpose: to let it survive. That usually means spreading to as many people as possible. That means bringing people in and keeping them hooked up and destroying its rivals, be they other religions or science or whatnot. And we humans, have been the tools to be controlled by these vicious, dangerous and single-minded memes to ensure <em>their</em> survival.</p>
<p>If you think the purpose of any long lasting and popular religion is human happiness, you should think again. <strong>The purpose of any religion is its own survival and dominance.</strong> A few million people here and there doesn&#8217;t make much difference as long as the long-term success of that meme is guaranteed.</p>
<p>To those of you who still think, in this day and age, that any idea like religion should be enforced or even be allowed to be advertised or be a part of any government or ruling body, I can only say to look at history. Look at your own lives! Look at our own lives and the lives of those like us!</p>
<p>For those libertarians and agnostics among you, I have to say that I don&#8217;t think religion is something to be ignored and always categorized as a personal choice. Religion is harmful and dangerous. It&#8217;s not only publicly recognized dangerous religions and ideologies like Nazism that are dangerous, but the idea of any mass of humans controlled by any religion. We cannot afford to remain agnostic any more. People are entitled to their own beliefs of course, but those beliefs should never ever be the basis for special treatment or ever be let to come to power anywhere at any time.</p>
]]></content:encoded>
			<wfw:commentRss>http://yaserzt.com/blog/archives/444/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>The Joker</title>
		<link>http://yaserzt.com/blog/archives/441</link>
		<comments>http://yaserzt.com/blog/archives/441#comments</comments>
		<pubDate>Fri, 08 Jan 2010 12:47:19 +0000</pubDate>
		<dc:creator>yzt</dc:creator>
				<category><![CDATA[fiction]]></category>
		<category><![CDATA[ignore]]></category>

		<guid isPermaLink="false">http://yaserzt.com/blog/?p=441</guid>
		<description><![CDATA[- This is boring. - Yes, it is. It&#8217;s all boring. - Except the bat. He is not boring. - Not all the time though. He gets boring sometimes, with his ethics and stuff. - But he can be very entertaining too. - Agreed! - I&#8217;m bored! - Yeah, we are. I wonder what happens [...]]]></description>
			<content:encoded><![CDATA[<p>- This is boring.<br />
- Yes, it is. It&#8217;s all boring.<br />
- Except the bat. He is not boring.<br />
- Not all the time though. He gets boring sometimes, with his ethics and stuff.<br />
- But he can be very entertaining too.<br />
- Agreed!<br />
- I&#8217;m bored!<br />
- Yeah, we are. I wonder what happens if I shoot that guy.<br />
- Hehehe! We got him in the gut!<br />
- Yeah, we did. His stomach acid must be gushing out onto the rest of his organs. Imagine the fun in there!<br />
- But why did I shot the man who was supposed to open the safe for me?<br />
- Who cares?! Let&#8217;s kill someone else too!<br />
- Let&#8217;s throw the gun in the middle of the hostages and see what happens!<br />
- Oooh! Look at them going for it.<br />
- Look at that idiot henchman of mine mowing them down with his Uzi!<br />
- This is entertaining!<br />
- Yes it is. Yes it is.<br />
&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://yaserzt.com/blog/archives/441/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Human and the Machine</title>
		<link>http://yaserzt.com/blog/archives/439</link>
		<comments>http://yaserzt.com/blog/archives/439#comments</comments>
		<pubDate>Wed, 16 Dec 2009 07:27:44 +0000</pubDate>
		<dc:creator>yzt</dc:creator>
				<category><![CDATA[life]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[rants]]></category>

		<guid isPermaLink="false">http://yaserzt.com/blog/?p=439</guid>
		<description><![CDATA[I was watching George Dyson&#8217;s interesting presentation at TED about birth of the digital computer, and something rather frightening occurred to me. When I started out with computers, maybe 18 years ago, I was in awe of them. Computers and what they did were a closed book to me, the way a great musician&#8217;s work [...]]]></description>
			<content:encoded><![CDATA[<p>I was watching George Dyson&#8217;s <a href="http://www.ted.com/talks/george_dyson_at_the_birth_of_the_computer.html">interesting presentation</a> at TED about birth of the digital computer, and something rather frightening occurred to me.<br />
When I started out with computers, maybe 18 years ago, I was in awe of them. Computers and what they did were a closed book to me, the way a great musician&#8217;s work is shrouded in mystery for me, yet I was enjoying their output and imagining what else they would do. Pretty much everything surprised and delighted me. As I grew more familiar with their working and started writing code, my awe remained but it also transformed, to a kind that maybe a musics student feels when seeing a true master play.<br />
The awe and delight pretty much remained as I grew closer and closer to the machine, I knew more, but it still was like seeing a loved one achieve a great accomplishment or part of a great orchestra that plays a fantastic piece. Seeing beauty even from inside inspires awe. Of course, I&#8217;m not suggesting that I was any good at any time, merely describing what I felt.<br />
In general, it was a like a love affair. Every little things, even the hiccups were strangely endearing. I wouldn&#8217;t think of computers as a machine. Of course, the hardware is a piece of dead equipment, but there is something else in there and I think I felt it. The Ghost in the Machine. I was in love with the ideas behind the hardware. I never thought of myself as a master of the machine, or it just another tool like a can opener or something. We were conversing with each other and we took nothing for granted. If something didn&#8217;t work, it was neither my fault, nor its; the problem was in the communication.<br />
But then my view started to change. I started to rely on certain things to work and certain things to go wrong. I started to view the computer as a terminal for information, as a tool for bilateral delivery of entertainment, data, software or communication with other humans. The machine started to get transparent in the process, the way your door is a transparent method of getting in and out of your home. The door is there, and you know how to use it, but the door itself is not at all important. The stuff and places on either side is what is important.<br />
This change kinda creeped onto me. Today I was forced to think about it, and I was shocked and terrified to realize that most of that awe has shifted from the machine to other people. The machine is no longer there, only those who designed and built the hardware and software. I don&#8217;t know how to exactly explain my feeling, and my depiction here is not exactly accurate. But I have lost the reverence for the love of my life, and I am a worse person for it. And I am sadder, and certainly a worse programmer, which is ultimately the most important aspect of my life. Oh, I do write better code and probably design better today than any time in the past, but I am nonetheless a worse coder and programmer, because I have lost the sparkle, and the love and ability to be pleasantly surprised no matter what.</p>
]]></content:encoded>
			<wfw:commentRss>http://yaserzt.com/blog/archives/439/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>United States of Zombieland</title>
		<link>http://yaserzt.com/blog/archives/436</link>
		<comments>http://yaserzt.com/blog/archives/436#comments</comments>
		<pubDate>Fri, 20 Nov 2009 04:33:37 +0000</pubDate>
		<dc:creator>yzt</dc:creator>
				<category><![CDATA[entertainment]]></category>

		<guid isPermaLink="false">http://yaserzt.com/blog/2009/11/20/united-states-of-zombieland/</guid>
		<description><![CDATA[The other day, my brother Ehsan recommended two new movies for me to see. One was Tarantino&#8216;s &#8220;Inglorious Basterds&#8220;, which is of course a no-brainer, and the other was &#8220;Zombieland&#8220;. Man his taste is impeccable! I am now exactly 3 minutes and 14 seconds into the film (I swear to all the Random Number Gods [...]]]></description>
			<content:encoded><![CDATA[<p>The other day, my brother Ehsan recommended two new movies for me to see. One was <a href="http://en.wikipedia.org/wiki/Quentin_Tarantino">Tarantino</a>&#8216;s &#8220;<a href="http://www.imdb.com/title/tt0361748/">Inglorious Basterds</a>&#8220;, which is of course a no-brainer, and the other was &#8220;<a href="http://www.imdb.com/title/tt1156398/">Zombieland</a>&#8220;. Man his taste is impeccable!<br />
I am now exactly 3 minutes and 14 seconds into the film (I swear to all the Random Number Gods that it was a coincidence!) and I <em>love</em> this movie already!<br />
Guess what the track on the film&#8217;s opening credits is! Frakking &#8220;<a href="http://en.wikipedia.org/wiki/For_Whom_the_Bell_Tolls_%28Metallica_song%29">For Whom the Bell Tolls</a>&#8220;!</p>
<p>P.S. I&#8217;m finally back in Tehran after a three-hour-plus flight delay.</p>
]]></content:encoded>
			<wfw:commentRss>http://yaserzt.com/blog/archives/436/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Dragon Age, plus God of War Collection</title>
		<link>http://yaserzt.com/blog/archives/433</link>
		<comments>http://yaserzt.com/blog/archives/433#comments</comments>
		<pubDate>Fri, 06 Nov 2009 15:19:26 +0000</pubDate>
		<dc:creator>yzt</dc:creator>
				<category><![CDATA[books]]></category>
		<category><![CDATA[entertainment]]></category>
		<category><![CDATA[noteworthy]]></category>

		<guid isPermaLink="false">http://yaserzt.com/blog/2009/11/06/dragon-age-plus-god-of-war-collection/</guid>
		<description><![CDATA[I had heard of the new Bioware RPG Dragon Age: Origins but I guess I had forgotten about it. Today, I stumbled upon a couple of reviews and some videos and now I&#8217;m in love with the game! It appears to be very long (which probably means a few months of gameplay for me; yay!), [...]]]></description>
			<content:encoded><![CDATA[<p>I had heard of the new Bioware RPG <a href="http://dragonage.bioware.com/"><strong>Dragon Age: Origins</strong></a> but I guess I had forgotten about it. Today, I stumbled upon a couple of reviews and some videos and now I&#8217;m in love with the game! It appears to be very long (which probably means a few months of gameplay for me; yay!), difficult, deep and true to classic Bioware-RPGs. Almost everyone calls it a great successor to the Baldur&#8217;s Gate duo. And I enjoy Bioware games, from Baldur&#8217;s Gate and Neverwinter Nights to Mass Effect (yes, even KOTOR games!) My only worry is the departure from almost strict D&#038;D ruleset of BG and NWN.<br />
In any case, I&#8217;m downloading the whole 8GBs right now, unless somebody knows whether stores over here have got the game?</p>
<p>In other news, I finally got my hands on the <strong>God of War Collection</strong> trailer. For those rare GoW-challenged people among my audience, the Collection is a remastered version of the first two God of War games for the PS3 (they where released for the PS2 originally.) It seems that, as they had promised, SONY has not changed anything in the games, and just packed some higher resolution textures and (maybe) animations, which is a wise move. The first two GoWs deserve to be preserve at the masterpiece of gameplay they are. This will be release this month.<br />
Obviously, the above means I <em>have</em> to get my own PS3. As soon as I figure out a robust solution to get both video and audio out of the PS3 and into my 1080p-capable but HDMI-incapable monitor and my speakers, I&#8217;m taking the trip to the Toopkhuneh(!) square and getting me a 120GiB PS3 Slim.</p>
<p>In yet other news, late last month (a day before my own birthday in fact) the twelfth book in the amazing and fantastic fantasy series <strong>The Wheel of Time</strong> has been released. It was supposed to be in November too IIRC, which makes the release a nice surprise. I&#8217;m already a fourth into the book and I&#8217;m liking it! May Robert Jordan rest in pieces&#8230; oops!&#8230; rest in peace.<br />
I have one thing to say to anyone who likes high fantasy at all: <em>GO READ THE BOOKS</em>. The whole 12000-13000 pages of pure immersion and greatness. Doesn&#8217;t matter what other people say. I have read enough fantasy series to know which one is great! Go read it. Read the first book if you feel you don&#8217;t have the time. Do yourself a favor.</p>
]]></content:encoded>
			<wfw:commentRss>http://yaserzt.com/blog/archives/433/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title></title>
		<link>http://yaserzt.com/blog/archives/431</link>
		<comments>http://yaserzt.com/blog/archives/431#comments</comments>
		<pubDate>Fri, 30 Oct 2009 00:44:37 +0000</pubDate>
		<dc:creator>yzt</dc:creator>
				<category><![CDATA[ignore]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[rants]]></category>

		<guid isPermaLink="false">http://yaserzt.com/blog/?p=431</guid>
		<description><![CDATA[Tonight was the first time ever that I drank alone. I was, am, in a very bad mood. I sat on my couch and downed a third of bottle of whiskey, and then I cooked for myself too (that&#8217;s almost another first.) No matter how hard I try to forget what I did that led [...]]]></description>
			<content:encoded><![CDATA[<p>Tonight was the first time ever that I drank alone. I was, am, in a very bad mood. I sat on my couch and downed a third of bottle of whiskey, and then I cooked for myself too (that&#8217;s almost another first.) No matter how hard I try to forget what I did that led to this evening, I can&#8217;t.<br />
I&#8217;m sitting here, alone, and I am sinking. I can&#8217;t stop crying. Remorse is not even an option. Even death is not an option.<br />
I realized tonight that I am a real asshole. Not a lazy guy, not a very bad procrastinator, not a liar, not a completely useless person, not a drama queen; a real asshole and a very bad human being.<br />
I think I need professional help. Shit. I do.</p>
]]></content:encoded>
			<wfw:commentRss>http://yaserzt.com/blog/archives/431/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Lighning Through the Skull</title>
		<link>http://yaserzt.com/blog/archives/426</link>
		<comments>http://yaserzt.com/blog/archives/426#comments</comments>
		<pubDate>Wed, 28 Oct 2009 01:54:38 +0000</pubDate>
		<dc:creator>yzt</dc:creator>
				<category><![CDATA[ignore]]></category>
		<category><![CDATA[rants]]></category>

		<guid isPermaLink="false">http://yaserzt.com/blog/?p=426</guid>
		<description><![CDATA[I am walking on asphalt, on an endless field of black asphalt, when out of the black black sky, a single bolt of lightning hits me. My eyes are the first things that explode out of their sockets. My hair catches on fire. My brain evaporates instantly, and the high pressure mixture pours out of [...]]]></description>
			<content:encoded><![CDATA[<p>I am walking on asphalt, on an endless field of black asphalt, when out of the black black sky, a single bolt of lightning hits me.<br />
My eyes are the first things that explode out of their sockets. My hair catches on fire. My brain evaporates instantly, and the high pressure mixture pours out of my ears and nose. The skin on my eyeless face melts off. My skull shatters. My jaws spasm so hard that not only I bite off my tongue that is caught between them, but also most of my teeth are crushed to bits. My blood boils in a flash and my heart explodes inside my chest along with most of my major veins. The liquid in my stomach and my intestines flash boils too and burns through my abdominal wall. Almost all the muscle and flesh and sinew in my body are busy tearing themselves off from the rest or trying to burn. Some of my bones dry out in the space between two seconds and get ground into a thousand pieces. The skin, flesh and tissue of my extremities melt and my fingers and toes (not to mention the rest) are fused together in a shapeless lump. My feet have already turned to liquid wax and are spreading on the ground.<br />
The charred wreckage that once spent his nights <em>trying</em> to optimize his assembly code remains there under the black black sky. Good thing I didn&#8217;t have my laptop with me, or the fall could have scratched it.</p>
<p>It&#8217;s that damn Gates&#8217; birthday again.</p>
]]></content:encoded>
			<wfw:commentRss>http://yaserzt.com/blog/archives/426/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fun with C++: new, delete and Some of the Rest of the Story</title>
		<link>http://yaserzt.com/blog/archives/416</link>
		<comments>http://yaserzt.com/blog/archives/416#comments</comments>
		<pubDate>Thu, 22 Oct 2009 02:57:59 +0000</pubDate>
		<dc:creator>yzt</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://yaserzt.com/blog/?p=416</guid>
		<description><![CDATA[Every C++ programmer knows new and delete and how they work. At least it must be so. I sure as hell didn&#8217;t know all the theory and detail behind C++ memory management facilities until 3-4 years ago, and I&#8217;m obviously still learning the practical details. So, please bear with me and see if there are [...]]]></description>
			<content:encoded><![CDATA[<p>Every C++ programmer knows <tt>new</tt> and <tt>delete</tt> and how they work. At least it must be so. I sure as hell didn&#8217;t know all the theory and detail behind C++ memory management facilities until 3-4 years ago, and I&#8217;m obviously still learning the practical details. So, please bear with me and see if there are things that you can learn about these old pals of ours, <tt>new</tt> and <tt>delete</tt>.</p>
<p>First, we all should know that <tt>new</tt> and <tt>delete</tt> are C++ operators, with all their facilities (and shortcomings, of course.) But not exactly like other operators, you can override them at a global level for every type that does not provide its own type-specific such operators. These global operators are provided as part of the C++ runtime library and are easily overridden. Their declarations are:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #666666;">// The single-object versions</span>
<span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span> operator <span style="color: #0000dd;">new</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">size_t</span> mem_size<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #0000ff;">void</span> operator <span style="color: #0000dd;">delete</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span> mem_block<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
<span style="color: #666666;">// The array versions</span>
<span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span> operator <span style="color: #0000dd;">new</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">size_t</span> mem_size<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #0000ff;">void</span> operator <span style="color: #0000dd;">delete</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span> mem_block<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></pre></td></tr></table></div>

<p>What <tt>new</tt> does is allocate a block of memory, and then call the constructor for the type with the address of the newly allocated block passed in as the <tt>this</tt> pointer. A <tt>delete</tt> call does the reverse; calling the destructor and then de-allocating the memory. The difference between the single-object versions and the array versions is only in the number of c&#8217;tor/d&#8217;tors they call. It amazes me how many C++ programmers don&#8217;t know and don&#8217;t care about details such as this (if you are programming in C++, these kind of details can and will bite you in the places you don&#8217;t want to be bitten!) If you fail to match them correctly, they allocate and de-allocate the correct amount of memory for the array or the single object, they just might not call constructors and destructors for all the objects being allocated or freed. That&#8217;s it.</p>
<p>Also, there is that small detail about exception-handling handling (yeah, two &#8220;handling&#8221;s!) The <tt>new</tt> operators may only <tt>throw</tt> an object of a sub-type of <tt>std::bad_alloc</tt> and only in the event that the requested amount of memory cannot be allocated. <tt>delete</tt> operators should never throw any exceptions (just like destructors. Remember that!) So, the correct<em>er</em> declaration for these operators would be:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #666666;">// The single-object versions</span>
<span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span> operator <span style="color: #0000dd;">new</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">size_t</span> mem_size<span style="color: #008000;">&#41;</span> <span style="color: #0000ff;">throw</span> <span style="color: #008000;">&#40;</span>std<span style="color: #008080;">::</span><span style="color: #007788;">bad_alloc</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #0000ff;">void</span> operator <span style="color: #0000dd;">delete</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span> mem_block<span style="color: #008000;">&#41;</span> <span style="color: #0000ff;">throw</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
<span style="color: #666666;">// The array versions</span>
<span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span> operator <span style="color: #0000dd;">new</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">size_t</span> mem_size<span style="color: #008000;">&#41;</span> <span style="color: #0000ff;">throw</span> <span style="color: #008000;">&#40;</span>std<span style="color: #008080;">::</span><span style="color: #007788;">bad_alloc</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #0000ff;">void</span> operator <span style="color: #0000dd;">delete</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span> mem_block<span style="color: #008000;">&#41;</span> <span style="color: #0000ff;">throw</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></pre></td></tr></table></div>

<p>Again, it is amazing how many programmers either don&#8217;t know about function exception specification and exception safety or just don&#8217;t use them (that includes me.) Of course, compiler providers are at least a little to blame here too. For example, Microsoft C++ compiler only distinguishes the empty exception list after a function declaration (meaning it doesn&#8217;t throw anything.) Anything else put there, just is taken to mean the default behavior is used (i.e. this function does throw something sometimes.)<br />
In the meantime, the relationship between C++ programmers and exception handling remains in the love/hate/ignorance/hate/apathy/hate stage.</p>
<p>Later on, I&#8217;m going to talk abut overloading these global operators for fun and profit. Stay tuned! <img src='http://yaserzt.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Obviously, a related problem to memory management is calling the c&#8217;tor and d&#8217;tor for an object directly. Uses for this may not be immediately apparent, but as a few examples I could name implementing good smart pointers, memory pools, memory managers, garbage collectors, generic object containers (e.g. <tt>std::vector</tt>) and such.<br />
You probably already know how to call the destructor on an instance directly. If you have a pointer <tt>x</tt> to an object of type <tt>T</tt>, you can call its d&#8217;tor like this: <tt>x->~T()</tt> (note that you should not generally call the d&#8217;tor in this way, unless you yourself have called the c&#8217;tor directly on that instance as well.) Calling the constructor is a bit trickier though (not really; I&#8217;m just being foreboding!)</p>
<p>What you should realize is that you can overload <tt>new</tt> and <tt>delete</tt> with different signatures that the ones above. You can add arguments and of different types. There are a few other signatures for these two provided by the standard C++ library (yeah, there are others!) The less interesting of them are:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>8
9
10
11
12
</pre></td><td class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span> operator <span style="color: #0000dd;">new</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">size_t</span> mem_size, std<span style="color: #008080;">::</span><span style="color: #007788;">nothrow_t</span> <span style="color: #0000ff;">const</span> <span style="color: #000040;">&amp;</span> please_dont<span style="color: #008000;">&#41;</span> <span style="color: #0000ff;">throw</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #0000ff;">void</span> operator <span style="color: #0000dd;">delete</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span> mem_block, std<span style="color: #008080;">::</span><span style="color: #007788;">nothrow_t</span> <span style="color: #0000ff;">const</span> <span style="color: #000040;">&amp;</span> please_dont<span style="color: #008000;">&#41;</span> <span style="color: #0000ff;">throw</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
<span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span> operator <span style="color: #0000dd;">new</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">size_t</span> mem_size, <span style="color: #0000ff;">const</span> std<span style="color: #008080;">::</span><span style="color: #007788;">nothrow_t</span> <span style="color: #000040;">&amp;</span> please_dont<span style="color: #008000;">&#41;</span> <span style="color: #0000ff;">throw</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #0000ff;">void</span> operator <span style="color: #0000dd;">delete</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span> mem_block, std<span style="color: #008080;">::</span><span style="color: #007788;">nothrow_t</span> <span style="color: #0000ff;">const</span> <span style="color: #000040;">&amp;</span> please_dont<span style="color: #008000;">&#41;</span> <span style="color: #0000ff;">throw</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></pre></td></tr></table></div>

<p>Forget about the <tt>delete</tt>s for a minute. The additional parameters to the <tt>new</tt> calls above are actually not used inside of the functions. Any object of type <tt>std::nothrow_t</tt> will suffice as the second parameter; it will be there just to signal the compiler to use this particular overload of the operator, which doesn&#8217;t throw any exceptions whatsoever. I just need to emphasize again that the regular <tt>new</tt> never returns a <tt>NULL</tt> pointer. It just throws an exception. But this one returns a 0 pointer upon failure and never throws anything, being it rocks, shoes or exceptions. The syntax for calling them, as you might suspect, is peculiar:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #339900;">#include &lt;new&gt;  // for std::nothrow</span>
<span style="color: #666666;">//...</span>
T <span style="color: #000040;">*</span> p <span style="color: #000080;">=</span> <span style="color: #0000dd;">new</span> <span style="color: #008000;">&#40;</span>std<span style="color: #008080;">::</span><span style="color: #007788;">nothrow</span><span style="color: #008000;">&#41;</span> T <span style="color: #008000;">&#40;</span><span style="color: #ff0000; font-style: italic;">/* usual constructor parameters */</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #666666;">// The line above calls a particular &quot;new&quot; overload with two</span>
<span style="color: #666666;">// parameters: a size_t and a std::nothrow_t.</span>
<span style="color: #666666;">// Oh, and std::nothrow is just an object of type std::nothrow_t.</span>
<span style="color: #666666;">//... </span>
<span style="color: #0000dd;">delete</span> p<span style="color: #008080;">;</span></pre></td></tr></table></div>

<p>Notice that I didn&#8217;t call the <tt>delete</tt> with any extra parameters or anything. In fact, <em>there is no syntax in C++ for calling <tt>delete</tt> with any parameters!</em> Besides, <tt>delete</tt> is already a non-throwing function. So what gives?! Why is there a paired <tt>delete</tt> for every frakking <tt>new</tt> when there is no frakking way of calling them?! You should keep your cool. I may explain them (if you don&#8217;t already know,) or we can leave the subject as an exercise. I would just say that the paired <tt>delete</tt> is called by the code generated by the compiler in a very specific situation.</p>
<p>Note that anything other than the straightforward, unary <tt>new</tt> and <tt>delete</tt> is called a &#8220;<em>placement</em> <tt>new</tt>/<tt>delete</tt>&#8220;. However, I&#8217;ve heard the term be used for a specific overload, which is more interesting and looks like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>21
22
23
24
25
</pre></td><td class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span> operator <span style="color: #0000dd;">new</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">size_t</span> mem_size, <span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span> mem_ptr<span style="color: #008000;">&#41;</span> <span style="color: #0000ff;">throw</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #0000ff;">void</span> operator <span style="color: #0000dd;">delete</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span> mem_block, <span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span> mem_ptr<span style="color: #008000;">&#41;</span> <span style="color: #0000ff;">throw</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
<span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span> operator <span style="color: #0000dd;">new</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">size_t</span> mem_size, <span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span> mem_ptr<span style="color: #008000;">&#41;</span> <span style="color: #0000ff;">throw</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #0000ff;">void</span> operator <span style="color: #0000dd;">delete</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span> mem_block, <span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span> mem_ptr<span style="color: #008000;">&#41;</span> <span style="color: #0000ff;">throw</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></pre></td></tr></table></div>

<p>The implementations for the above operators are really simple. Here&#8217;s a complete listing:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
</pre></td><td class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span> operator <span style="color: #0000dd;">new</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">size_t</span> mem_size, <span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span> mem_ptr<span style="color: #008000;">&#41;</span> <span style="color: #0000ff;">throw</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    <span style="color: #0000ff;">return</span> mem_ptr<span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #0000ff;">void</span> operator <span style="color: #0000dd;">delete</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span> mem_block, <span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span> mem_ptr<span style="color: #008000;">&#41;</span> <span style="color: #0000ff;">throw</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span> operator <span style="color: #0000dd;">new</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">size_t</span> mem_size, <span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span> mem_ptr<span style="color: #008000;">&#41;</span> <span style="color: #0000ff;">throw</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    <span style="color: #0000ff;">return</span> mem_ptr<span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #0000ff;">void</span> operator <span style="color: #0000dd;">delete</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span> mem_block, <span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span> mem_ptr<span style="color: #008000;">&#41;</span> <span style="color: #0000ff;">throw</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>Note that although I haven&#8217;t written it, the constructor and destructor calls happen outside of my control. These versions of <tt>new</tt> and <tt>delete</tt> are used when we <em>don&#8217;t</em> want to allocate or free any memory, and just want the constructors and destructors to be called. For <tt>new</tt>, we just pass in a pointer to another sufficiently-sized memory location and ask the compiler to generate the code to call the c&#8217;tor upon that area of memory. That&#8217;s how we call a c&#8217;tor directly. We procure some memory area from somewhere and use that, like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>43
44
45
</pre></td><td class="code"><pre class="cpp" style="font-family:monospace;">T <span style="color: #000040;">*</span> x <span style="color: #000080;">=</span> <span style="color: #008000;">&#40;</span>T <span style="color: #000040;">*</span><span style="color: #008000;">&#41;</span><span style="color: #0000dd;">malloc</span> <span style="color: #008000;">&#40;</span><span style="color: #0000dd;">10</span> <span style="color: #000040;">*</span> <span style="color: #0000dd;">sizeof</span><span style="color: #008000;">&#40;</span>T<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">unsigned</span> i <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i <span style="color: #000080;">&lt;</span> <span style="color: #0000dd;">10</span><span style="color: #008080;">;</span> <span style="color: #000040;">++</span>i<span style="color: #008000;">&#41;</span>
    x<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> <span style="color: #0000dd;">new</span> <span style="color: #008000;">&#40;</span>x <span style="color: #000040;">+</span> i<span style="color: #008000;">&#41;</span> T <span style="color: #008000;">&#40;</span><span style="color: #ff0000; font-style: italic;">/*usual c'tor params. */</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></pre></td></tr></table></div>

<p>These standard placement operators cannot be hidden or overridden in user code, but there is still a ton of fun to be had.</p>
<p>You can very easily replace the old, simple and default operators with an implementation of yours, a la:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>46
47
48
49
50
51
52
53
54
55
56
57
58
59
</pre></td><td class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span> operator <span style="color: #0000dd;">new</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">size_t</span> mem_size<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    <span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span> ret <span style="color: #000080;">=</span> <span style="color: #0000dd;">malloc</span> <span style="color: #008000;">&#40;</span>mem_size<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #0000dd;">0</span> <span style="color: #000080;">==</span> ret<span style="color: #008000;">&#41;</span>
        <span style="color: #0000ff;">throw</span> std<span style="color: #008080;">::</span><span style="color: #007788;">bad_alloc</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    <span style="color: #0000ff;">return</span> ret<span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #0000ff;">void</span> <span style="color: #0000dd;">delete</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span> mem_block<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    <span style="color: #0000dd;">free</span> <span style="color: #008000;">&#40;</span>mem_block<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #666666;">// the array versions are exactly the same</span></pre></td></tr></table></div>

<p>As I have stated earlier, the c&#8217;tor/d&#8217;tor calls are generated automatically for you by the compiler. So now you are free to write your own memory manager!</p>
<p>The way that memory manager/debugger/helper/whatevers usually work under the hood is that they allocate more memory than you have requested, and put their own junk right before and/or right after the area that gets passed back to the user (that&#8217;s a bad way to do memory management, but that one is a long story.) Some of the stuff that are usually kept there include a pointer to the next and/or previous allocated block of memory (so all the blocks form a linked list,) sentinel values right before and right after the user area to detect buffer overruns (e.g. <tt>0xdeadbabe</tt>,) the size of the memory block, the code file/line/function/module that allocated this particular block and so on and so forth. Actually, your default memory manager in the CRT is doing this right now. Just <tt>new</tt> two large-enough blocks of memory and compare their address differences with the size of the first block. The runtime accompanying some compilers (like VC++) even exposes their internal data structures and means to work with the memory manager (although rather passively.)</p>
<p>You need to keep in mind though, that what I have discussed so far barely scratches the surface of writing memory managers. These are just practicalities and implementation details; the state of the art on the theory of the matter and memory allocation algorithms, policies and mechanisms can fill several books. Even on the implementation side, there are really serious issues with performance, cache-friendliness, thread-safety, multiple thread support, etc. need taking care of.<br />
Besides, much (if not most) of the memory (de)allocation going on in a C++ program these days go through C or operation system API, shared object files (DLLs,) through third part code or through STL, all of which bypass the basic technique discussed above. So, if you really are serious, you should investigate the existing memory debuggers or memory leak detectors or memory managers. There are several open source ones out there, with various degrees of sophistication and complexity. Have fun! (But for what it&#8217;s worth, I should mention that we have used a memory leak detector using nothing but this technique in <a href="http://garshasp.com/">Garshasp</a> and a similar project before, and in both projects it has been a great help.)</p>
]]></content:encoded>
			<wfw:commentRss>http://yaserzt.com/blog/archives/416/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Darth Vader in the &#8220;House&#8221;!</title>
		<link>http://yaserzt.com/blog/archives/412</link>
		<comments>http://yaserzt.com/blog/archives/412#comments</comments>
		<pubDate>Tue, 06 Oct 2009 12:49:43 +0000</pubDate>
		<dc:creator>yzt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://yaserzt.com/blog/?p=412</guid>
		<description><![CDATA[Holy Shit! It&#8217;s James Earl Jones appearing in the latest episode of House! That voice, even after 30 years, is the most powerful and commanding voice in the whole frakking Galaxy; this one or the other one Far Far Away. There is even a bit of &#8220;Darth Vader breathing&#8221; in there! Try reading the following [...]]]></description>
			<content:encoded><![CDATA[<p>Holy Shit! It&#8217;s James Earl Jones appearing in the latest episode of House!<br />
That voice, even after 30 years, is the most powerful and commanding voice in the whole frakking Galaxy; this one or the other one Far Far Away. <img src='http://yaserzt.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  There is even a bit of &#8220;Darth Vader breathing&#8221; in there!</p>
<p>Try reading the following with a picture of Darth Vader in front of you, his voice booming in your head, and preferably with a red-blade Light Saber replica on your mantelpiece (sorry folks, I really <em>do</em> have one of these!)</p>
<blockquote><p>You are sure [...]?</p></blockquote>
<blockquote><p>&#8230;Leave him alone.</p></blockquote>
<blockquote><p>We want you to use her blood.</p></blockquote>
<blockquote><p>Who is that man?!</p></blockquote>
<blockquote><p>My own son&#8230;</p></blockquote>
<blockquote><p>Inject my IV with an air bubble. I will have another heart attack and no one will know. [...] You were trying to put a gun in his hand and point it at my head. The gun is now in your hand. That is a practical difference, not a moral one.</p></blockquote>
<blockquote><p>In my world there are dangers and bloodshed and death, and that makes you a man. And men make choices.</p></blockquote>
<p>I just finished watching this 3rd episode of season 6 and it was a good one.</p>
<p>P.S. OK, that&#8217;s no way to come back and post to my blog after a few months, but give me a break; I&#8217;m trying to ease in (you know, 2x<sup>3</sup>-3x<sup>2</sup> style!)</p>
]]></content:encoded>
			<wfw:commentRss>http://yaserzt.com/blog/archives/412/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Self-justifying Choices</title>
		<link>http://yaserzt.com/blog/archives/410</link>
		<comments>http://yaserzt.com/blog/archives/410#comments</comments>
		<pubDate>Wed, 05 Aug 2009 10:18:51 +0000</pubDate>
		<dc:creator>yzt</dc:creator>
				<category><![CDATA[entertainment]]></category>
		<category><![CDATA[ignore]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[rants]]></category>

		<guid isPermaLink="false">http://yaserzt.com/blog/?p=410</guid>
		<description><![CDATA[Running away is a solution to many things. Giving up, throwing in the towel, passing the buck, unshouldering the burden, admitting your incapability, playing dead&#8230; It&#8217;s a perfect solution for mediocrity, isn&#8217;t it? If you thought that was the rant, you&#8217;re sourly mistaken. Here it is. Let&#8217;s try a thought experiment. Nothing real, just a [...]]]></description>
			<content:encoded><![CDATA[<p>Running away is a solution to many things. Giving up, throwing in the towel, passing the buck, unshouldering the burden, admitting your incapability, playing dead&#8230;<br />
It&#8217;s a perfect solution for mediocrity, isn&#8217;t it?</p>
<p>If you thought that was the rant, you&#8217;re sourly mistaken. Here it is.</p>
<p>Let&#8217;s try a <em>thought experiment</em>. Nothing real, just a wild and fantastical fantasy. Suppose you are standing on the edge of a rooftop, contemplating jumping down. As long as you haven&#8217;t jumped, the choice is always yours. You can jump, stay on the edge or move back. It&#8217;s not like you can&#8217;t jump two seconds or two hours later. If the situation changes, you can always weigh the odds again and make a more suitable choice.<br />
But what if you jump? You make a choice and you jump. I think that&#8217;s the best choice you can make; the most logical. If you stay on the edge, or you move back, the edge and the jump will always be there, tempting and tantalizing. Why defer the choice?<br />
Some might say because it&#8217;s a final choice and because you will always have the option, you can postpone it for later. It&#8217;s not like the edge is going anywhere, right? Wrong. I say you should always jump the first chance you get, because once you jump, there is no going back and there is no more choices. Why would you postpone a move that solves your dilemma so quickly? How come people (including myself) defer such obviously logical choices for more than a single second?<br />
I like these kind of choices. I like changes and commitments that you cannot revert. They simplify life so much.</p>
<blockquote><p>I think it&#8217;s kind of funny, I think it&#8217;s kind of sad,<br />
The memories in which I&#8217;m dying are the best I&#8217;ve ever had.</p></blockquote>
<p>That&#8217;s not about death of course. It&#8217;s about giving up in despair. It&#8217;s about indecision and inability to deal. It&#8217;s about petty problems that prove impossible for weak people.<br />
It&#8217;s about me.</p>
]]></content:encoded>
			<wfw:commentRss>http://yaserzt.com/blog/archives/410/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Apathy Their Stepping Stone</title>
		<link>http://yaserzt.com/blog/archives/408</link>
		<comments>http://yaserzt.com/blog/archives/408#comments</comments>
		<pubDate>Fri, 19 Jun 2009 21:33:08 +0000</pubDate>
		<dc:creator>yzt</dc:creator>
				<category><![CDATA[frak-them]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[rants]]></category>
		<category><![CDATA[stupidity]]></category>

		<guid isPermaLink="false">http://yaserzt.com/blog/?p=408</guid>
		<description><![CDATA[Justice Is Lost Justice Is Raped Justice Is Gone&#8230; &#8230;And no justice for all, because a bunch of petty, raisin-brained dictator-wannabes wanna be dictators. And frak them all.]]></description>
			<content:encoded><![CDATA[<blockquote><p>Justice Is Lost<br />
Justice Is Raped<br />
Justice Is Gone&#8230;</p></blockquote>
<p>&#8230;And no justice for all, because a bunch of petty, raisin-brained dictator-wannabes wanna be dictators. And frak them all.</p>
]]></content:encoded>
			<wfw:commentRss>http://yaserzt.com/blog/archives/408/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Stupidity Begets Stupidity</title>
		<link>http://yaserzt.com/blog/archives/406</link>
		<comments>http://yaserzt.com/blog/archives/406#comments</comments>
		<pubDate>Fri, 12 Jun 2009 21:46:35 +0000</pubDate>
		<dc:creator>yzt</dc:creator>
				<category><![CDATA[rants]]></category>

		<guid isPermaLink="false">http://yaserzt.com/blog/?p=406</guid>
		<description><![CDATA[Frak these stupid idiots. They deserve to be ruled by an even bigger idiot. I call them idiots, because in my book, that&#8217;s almost the worst insult. In any case, if Iranians indeed have voted for that arsehole, then we deserve him and nothing more. I&#8217;m pretty sure that I am unable to partake how [...]]]></description>
			<content:encoded><![CDATA[<p>Frak these stupid idiots. They deserve to be ruled by an even bigger idiot. I call them idiots, because in my book, that&#8217;s almost the worst insult.<br />
In any case, if Iranians indeed have voted for that arsehole, then we deserve him and nothing more. I&#8217;m pretty sure that I am unable to partake how angry I am. I have no words to describe what I feel properly. Right now, there is an army of Kratoses roaring and bellowing with rage, tearing flesh, breaking bone, burning everything and raining a maelstrom of blood.</p>
<p>Frak. Frak. Frak. Frak me sideways.</p>
]]></content:encoded>
			<wfw:commentRss>http://yaserzt.com/blog/archives/406/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Do Times Ever Change?</title>
		<link>http://yaserzt.com/blog/archives/404</link>
		<comments>http://yaserzt.com/blog/archives/404#comments</comments>
		<pubDate>Sat, 06 Jun 2009 07:11:48 +0000</pubDate>
		<dc:creator>yzt</dc:creator>
				<category><![CDATA[rants]]></category>
		<category><![CDATA[updated]]></category>

		<guid isPermaLink="false">http://yaserzt.com/blog/?p=404</guid>
		<description><![CDATA[I, like most of us in these days that we are nearing the presidential election, think a lot about the situation of our country and our pale blue dot. I, like most of us, am worried about where we are headed. I, like most of us, am skeptical about the election results and whether it&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p>I, like most of us in these days that we are nearing the presidential election, think a lot about the situation of our country and our pale blue dot.</p>
<p>I, like most of us, am worried about where we are headed. I, like most of us, am skeptical about the election results and whether it&#8217;ll have a real impact for the better. I don&#8217;t think anyone has any doubts about whether the times can get worse, because they sure can, as the past four years have shown. But for the better? I don&#8217;t know.</p>
<p>However, like many stupid young people, I have my hopes. I hope for for a more realistic government. One that is more in line with what the people want and need. You know what? I want a less stupid government. One that does not tell so many lies that even its own body starts believing them.</p>
<p>I hope for less religious mumbo jumbo and more information and wisdom. I want a government that works efficiently and knowledgeably and let&#8217;s people do whatever they want as long as they don&#8217;t break the law. And I want real, realistic and usable means to change the laws if they are broken and bad.</p>
<p>I want freedom. I want a government that is afraid of its people, not a people that are afraid of their government even when they are in their own bed. Even worse, I don&#8217;t want a people that don&#8217;t care about their government as long as it doesn&#8217;t step on their toes and vice versa.</p>
<p>I want people to listen to each other. I want people not to turn their head and pretend that they just don&#8217;t see. I don&#8217;t want the stupid idiots who decide my fate to still think that what is said in some book from several hundred years ago is absolute truth, no matter how strange, immoral, improbable, unacceptable, malicious and unscientific it is.</p>
<p>I don&#8217;t want my government officials to say that they do their job because some god says so in some book, or because it&#8217;s their religious obligation, or because some guy who died 1300 years ago is quoted to have wanted so.</p>
<p>I want them to do their job because the law says so, or because it&#8217;s their moral, social or logical obligation, or because the people want so.</p>
<p>I want some information. I am sick and tired of being treated like an idiot. I want freedom of the press and media. I know it&#8217;s got its own bag of problems, but hey, that&#8217;s much better than what we got already: all the problems of a media-driven and media-blinded society and 2% the functionality.</p>
<p>I want science and knowledge to have real value, not just as things to do in university as a way to pimp up your resumé to get the hell out of this dismal country. I want the wheels of industry, commerce, trade and technology to start turning and to move this country forward.</p>
<p>I want an education system that instead of force feeding children with crap and filling their heads with superstition and guilt and unreal notions of hope and salvation, teaches them to think and choose and provide them with data to support their choice. I want our schools to be playgrounds for the real world out there, not 11 years (or 12 or whatever the number currently is) of isolation from reality and Newspeak practice. I don&#8217;t want teenagers to learn more from ditching school than attending.</p>
<p>I want people to panic! I don&#8217;t want us to go about our lives like sheep the night before they are slaughtered, or like the anecdotal frog that never jumps out of the water that is slowly starting to boil. Our situation is very dire. I want to see people start screaming out of their windows that they are &#8220;mad as hell&#8221; and that they are &#8220;not going to take it anymore.&#8221; Why no one does that, unless it&#8217;s election time and they are one of the candidates and preferably there are more than three million watching?</p>
</p>
<p>On days like these, why it is that I find the immortal songs of Mr. Bob Dylan to be the ones that speak most loudly my heart and mind?</p>
<p>Do times ever change? Am I a fool to hope? Am I a simpleton to be <a href="http://www.youtube.com/watch?v=d-5JvACzGp8">knocking on heavens door</a>? In days like these, I feel like my hopes, and most people&#8217;s, are <a href="http://www.youtube.com/watch?v=ced8o50G9kg">blowing in the wind</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://yaserzt.com/blog/archives/404/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>جای خوب و خلوت</title>
		<link>http://yaserzt.com/blog/archives/396</link>
		<comments>http://yaserzt.com/blog/archives/396#comments</comments>
		<pubDate>Thu, 21 May 2009 23:09:16 +0000</pubDate>
		<dc:creator>yzt</dc:creator>
				<category><![CDATA[ignore]]></category>
		<category><![CDATA[life]]></category>

		<guid isPermaLink="false">http://yaserzt.com/blog/?p=396</guid>
		<description><![CDATA[بیشتر مردم دو مادر بزرگ و دو پدربزرگ دارند. پدرِ پدرم قبل از اینکه من &#8211; نوه اولش &#8211; به دنیا بیایم مرد. تنها چیزی که از او می‌دانم نامش است و شغلش و تنها نشانه‌اش دو سه عکس‌ای است که از او دیده‌ام. از مادرِ پدرم هنوز قیافه‌ای به یاد دارم. او هم وقتی [...]]]></description>
			<content:encoded><![CDATA[<div dir="rtl" lang="fa" style="text-align: right;">
بیشتر مردم دو مادر بزرگ و دو پدربزرگ دارند. پدرِ پدرم قبل از اینکه من &#8211; نوه اولش &#8211; به دنیا بیایم مرد. تنها چیزی که از او می‌دانم نامش است و شغلش و تنها نشانه‌اش دو سه عکس‌ای است که از او دیده‌ام. از مادرِ پدرم هنوز قیافه‌ای به یاد دارم. او هم وقتی سه سالم بود، پس از بیماری‌ای ظاهراً طولانی جان سپرد. هنوز گاهی سر قبرش می‌رویم.<br />
وقتی داشت هفت سالم می‌شد، پدرم را در حادثه‌ای که اگر این‌قدر تلخ نبود شاید از فرط سادگی مسخره می‌نمود از دست دادم. بعد از بیشتر از بیست سال، دیگر در زندگی من اثری از او نیست مگر جای خالی‌اش در کنار مادرم و زنندگی عکس مردی که حالا تازه باید پنجاه و پنج ساله باشد روی دیوار با یک روبان مشکی. آخرین خاطره‌ای که از پدرم دارم دعوایی بود که با من به خاطر شیطنتی احمقانه کرد. جالب نیست که این آخرین خاطره‌ام از پدری که دیگر صورتش و صدایش دارد از ذهنم می‌رود باشد؟<br />
اگر من ده برابرِ این چیزی که هستم انسان بهتری باشم با اراده قویتر و توانایی‌های بیشتر، باز هم نخواهم توانست پس از مرگ همسرم، هم درسِ رها شده‌ام را از سر بگیرم و تمام کنم، هم سه پسرم را بزرگ کنم و از آب و گل درآورم. مادرم دست‌کم ده برابر بهتر از من است.<br />
فکر می‌کنم شانزده ساله بودم &#8211; خنده‌دار است که درست به یاد ندارم &#8211; که پدربزرگم هم در اثر ابتلا به سرطان درگذشت. مرد جالبی بود. من که خیلی دوستش داشتم. دست کم فرصت داشتم این یکی را کمی بشناسم. هنوز هم گاهی یاد تکیه کلام‌ها و رفتارهایش می‌کنم.<br />
مادرِ مادرم بیشتر از ده سال است که به خاطر سکته مغزی قدرت حرکت دادن نیمی از بدنش را از دست داده. بیچاره مدتها با معلولیتش جنگید ولی یکی دوسالی است که دیگر حتی به کمک چهارپایه و عصاهای مخصوص هم راه نمی‌رود. این اواخر دیگر حتی از بسترش هم بر نمی‌خیزد. نمی‌دانید (یا شاید هم می‌دانید) که دیدن او چه سخت است وقتی به تنها چیزی که می‌توانم فکر کنم روزهایی است که در کودکی به خاطر بیماریِ سرخک یا سرخجه یا آبله‌مرغان روزهای متمادی به مدرسه نمی‌رفتم و در نبود مادرم او به من می‌رسید و به من چه خوش می‌گذشت. نمی‌دانید (یا شاید هم می‌دانید) که دیدن او چه سخت است وقتی هنوز طعم قرمه‌سبزی و لوبیاپلوی او زیر دندانم است. نمی‌دانید، یا شاید بدانید که ندیدن او چه سخت است. ولی می‌دانم که نمی‌دانید ندیدن مادرم چقدر سخت‌تر است.<br />
نام این پُستم را گذاشتم «جای خوب و خلوت». شاید بهترین توصیفی که درباره مرگ خوانده‌ام این شعرگونه از آرتور کلارک در کتاب آخر سری «راما» باشد:</p>
<blockquote><p>شنیده‌ام که گور جای خوب و خلوتی‌ست<br />
ولی کسی در آنجا تو را در آغوش نخواهد گرفت</p></blockquote>
</div>
]]></content:encoded>
			<wfw:commentRss>http://yaserzt.com/blog/archives/396/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
