<?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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>The Secret Diary of Han, Aged 0x29</title>
	<atom:link href="http://secretdiaryofhan.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://secretdiaryofhan.wordpress.com</link>
	<description>twitter.com/h4n</description>
	<lastBuildDate>Mon, 15 Aug 2011 10:37:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='secretdiaryofhan.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>The Secret Diary of Han, Aged 0x29</title>
		<link>http://secretdiaryofhan.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://secretdiaryofhan.wordpress.com/osd.xml" title="The Secret Diary of Han, Aged 0x29" />
	<atom:link rel='hub' href='http://secretdiaryofhan.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Life through the backdoor</title>
		<link>http://secretdiaryofhan.wordpress.com/2009/04/07/316/</link>
		<comments>http://secretdiaryofhan.wordpress.com/2009/04/07/316/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 01:15:59 +0000</pubDate>
		<dc:creator>Han</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://secretdiaryofhan.wordpress.com/?p=316</guid>
		<description><![CDATA[Ken Thompson once inserted a backdoor in the Unix login program by modifying the C compiler to compile a version of itself that would include the backdoor creating code. He could then delete the backdoor from the C compiler&#8217;s source code. Since the creation of the backdoor was now part of the machinery of compilation, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=secretdiaryofhan.wordpress.com&amp;blog=2183720&amp;post=316&amp;subd=secretdiaryofhan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://scienceblogs.com/goodmath/2007/04/strange_loops_dennis_ritchie_a.php">Ken Thompson once inserted a backdoor</a> in the Unix login program by modifying the C compiler to compile a version of itself that would include the backdoor creating code. He could then delete the backdoor from the C compiler&#8217;s source code. Since the creation of the backdoor was now part of the machinery of compilation, the binary executable C compiler, it did not need to be part of the C compiler&#8217;s source.</p>
<p>Once upon a time I did a PhD. Tradition in Holland has it that you can add a list of &#8220;positions&#8221; to your thesis, often unrelated to the PhD work, that you are willing to defend during the Q and A section of the PhD ceremony. I included a position that said something along the lines of &#8220;Our DNA does not contain all information necessary for our procreation&#8221;. What this alludes to is that there are bound to be &#8220;backdoors&#8221; in the machinery that creates us from our DNA.</p>
<p>The original source code for Ken Thompson&#8217;s C compiler backdoor could be deleted, because it was now part of the machinery. Similarly, it seems likely that the machinery that creates our proteins from our DNA will have evolved in such a way that parts of it no longer need to be coded for by the DNA directly. The information to recreate the machinery is now partly in the machinery itself, and over time the DNA encoding for those parts will have disappeared since the evolutionary pressure to keep that DNA intact is no longer there.</p>
<p>We start out life with DNA from our parents, but we also receive the protein building machinery from our mothers in the fertilized egg. Over time that machinery has evolved to great complexity. Our C compiler has many backdoors that it depends on for its proper functioning. And like Ken Thompson&#8217;s backdoor, there is no need to keep its DNA around. Our procreation needs not only our source code, but also that complex backdoor-rigged machinery that turns our source code into us.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/secretdiaryofhan.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/secretdiaryofhan.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/secretdiaryofhan.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/secretdiaryofhan.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/secretdiaryofhan.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/secretdiaryofhan.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/secretdiaryofhan.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/secretdiaryofhan.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/secretdiaryofhan.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/secretdiaryofhan.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/secretdiaryofhan.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/secretdiaryofhan.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/secretdiaryofhan.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/secretdiaryofhan.wordpress.com/316/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=secretdiaryofhan.wordpress.com&amp;blog=2183720&amp;post=316&amp;subd=secretdiaryofhan&amp;ref=&amp;feed=1" width="1" height="1" /><div class="sharedaddy"></div>]]></content:encoded>
			<wfw:commentRss>http://secretdiaryofhan.wordpress.com/2009/04/07/316/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f0bd4ed83708d0af0e0d1374fc7e605b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Han</media:title>
		</media:content>
	</item>
		<item>
		<title>It&#8217;s official: The iPhone 3G is toilet resistant</title>
		<link>http://secretdiaryofhan.wordpress.com/2008/07/28/its-official-the-iphone-3g-is-toilet-resistant/</link>
		<comments>http://secretdiaryofhan.wordpress.com/2008/07/28/its-official-the-iphone-3g-is-toilet-resistant/#comments</comments>
		<pubDate>Mon, 28 Jul 2008 04:38:53 +0000</pubDate>
		<dc:creator>Han</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://secretdiaryofhan.wordpress.com/?p=310</guid>
		<description><![CDATA[On Friday, on a slight belly flu induced toilet visit, the 2 week old iPhone managed to slip out of my rear pocket and into the bowl. I heard the clunk and knew it wasn&#8217;t good. Fortunately I hadn&#8217;t dropped anything else. When I fished it out, the screen had turned on and showed proof [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=secretdiaryofhan.wordpress.com&amp;blog=2183720&amp;post=310&amp;subd=secretdiaryofhan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>On Friday, on a slight belly flu induced toilet visit, the 2 week old iPhone managed to slip out of my rear pocket and into the bowl. I heard the clunk and knew it wasn&#8217;t good. Fortunately I hadn&#8217;t dropped anything else.</p>
<p>When I fished it out, the screen had turned on and showed proof of Apple&#8217;s amazing capability of anticipating usage scenarios:</p>
<p><a href="http://secretdiaryofhan.files.wordpress.com/2008/07/dscf1220.jpg"><img class="size-medium wp-image-312 alignnone" src="http://secretdiaryofhan.files.wordpress.com/2008/07/dscf1220.jpg?w=225&#038;h=300" alt="" width="225" height="300" /></a></p>
<p>Then the screen faded. Water had entered the screen and camera. What to do?</p>
<p>When dropping a mobile phone in water, here is what you should do immediately:</p>
<ol>
<li>Turn phone off</li>
<li>Remove battery</li>
</ol>
<p>Unfortunately, for number 1 you need a working touch screen, and for number 2 you need to visit the Apple store. The only option was to let it die a painful death. The screen came on a few times, flashing bright white, as iPhone desperately tried to breathe, but it finally died after about 15 minutes.</p>
<p>Not covered, can&#8217;t fix, visit Softbank to buy a replacement. This is what the genius in the Apple store told me an hour later. Instead I decided to go to <a href="http://en.wikipedia.org/wiki/Tokyu_Hands">Tokyu Hands</a> and bought a screw driver and a watch case opener. Back home I <a href="http://jp.youtube.com/watch?v=8fF0DF-mbn4">disassembled</a> the iPhone, and let it dry overnight.</p>
<p>The next morning I put it back together, which was considerably less straight forward than taking it apart. When I finally clicked the screen back into the case, fastened the two screws at the bottom, and  looked at the screen, there was the Apple logo! Some people get warm fuzzy feelings whenever they see the Apple logo. Not me. But this time must have made up for that. iPhone had resurrected. After installing the SIM card, it booted normally, and everything functions OK.</p>
<p>Well, except for the volume up button.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/secretdiaryofhan.wordpress.com/310/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/secretdiaryofhan.wordpress.com/310/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/secretdiaryofhan.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/secretdiaryofhan.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/secretdiaryofhan.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/secretdiaryofhan.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/secretdiaryofhan.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/secretdiaryofhan.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/secretdiaryofhan.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/secretdiaryofhan.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/secretdiaryofhan.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/secretdiaryofhan.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/secretdiaryofhan.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/secretdiaryofhan.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/secretdiaryofhan.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/secretdiaryofhan.wordpress.com/310/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=secretdiaryofhan.wordpress.com&amp;blog=2183720&amp;post=310&amp;subd=secretdiaryofhan&amp;ref=&amp;feed=1" width="1" height="1" /><div class="sharedaddy"></div>]]></content:encoded>
			<wfw:commentRss>http://secretdiaryofhan.wordpress.com/2008/07/28/its-official-the-iphone-3g-is-toilet-resistant/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f0bd4ed83708d0af0e0d1374fc7e605b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Han</media:title>
		</media:content>

		<media:content url="http://secretdiaryofhan.files.wordpress.com/2008/07/dscf1220.jpg?w=225" medium="image" />
	</item>
		<item>
		<title>Including remote javascript in a bookmarklet</title>
		<link>http://secretdiaryofhan.wordpress.com/2008/02/02/including-remote-javascript-in-a-bookmarklet/</link>
		<comments>http://secretdiaryofhan.wordpress.com/2008/02/02/including-remote-javascript-in-a-bookmarklet/#comments</comments>
		<pubDate>Sat, 02 Feb 2008 09:51:42 +0000</pubDate>
		<dc:creator>Han</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[javascript bookmarklet]]></category>

		<guid isPermaLink="false">http://secretdiaryofhan.wordpress.com/?p=309</guid>
		<description><![CDATA[The size of a URL is limited to 488 characters in IE 6 SP2. This limits what can be done in a bookmarklet. Fortunately it&#8217;s possible to include external javascript. Unfortunately, IE 6 again makes things more difficult that they should be. To load a remote a remote javascript file, just construct a script tag [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=secretdiaryofhan.wordpress.com&amp;blog=2183720&amp;post=309&amp;subd=secretdiaryofhan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The size of a URL is limited to <a href="http://www.subsimple.com/bookmarklets/rules.asp">488</a> characters in IE 6 SP2. This limits what can be done in a bookmarklet. Fortunately it&#8217;s possible to include external javascript. Unfortunately, IE 6 again makes things more difficult that they should be.</p>
<p>To load a remote a remote javascript file, just construct a script tag and insert it into the document body. To call a function, in order to feed it some data stored in the bookmarklet, set the &#8220;onload&#8221; attribute to a callback to be invoked when loading is ready:</p>
<pre class="brush: jscript;">
(function() {
  var d=document;
  var s=d.createElement(&quot;script&quot;);
  s.onload = function() {enter()}; // enter is a function defined in the loaded script
  s.src=&quot;/path/to/java/script.js&quot;;
  d.body.appendChild(s);
})();</pre>
<p>This works nicely in Firefox, Safari and Opera. </p>
<p>The problem is, loading the script is synchronous in IE (both 6 and 7), and the onload callback does not get called. This in spite of <a href="http://msdn2.microsoft.com/en-us/library/ms536942.aspx">MSDN documentation</a> claiming that onload on script tags is honored. However, since loading is synchronous, the script will have completed loading in IE when the appendChild call returns. A workaround, then, is to call the callback explicitly after the appendChild call, but guard it with a flag so that it is run only once.</p>
<pre class="brush: jscript;">
(function() {
  var d=document;
  var s=d.createElement(&quot;script&quot;);
  s.onload = function() {enter()}; // enter is a function defined in the loaded script
  s.src=&quot;/path/to/java/script.js&quot;;
  d.body.appendChild(s);
  if (window.enter)
    enter();
})();

// &quot;enter&quot; function in included javascript file:
var entered = false;
function enter() {
  if (entered)
    return;

  entered = true;
  //...
}     
</pre>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/secretdiaryofhan.wordpress.com/309/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/secretdiaryofhan.wordpress.com/309/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/secretdiaryofhan.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/secretdiaryofhan.wordpress.com/309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/secretdiaryofhan.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/secretdiaryofhan.wordpress.com/309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/secretdiaryofhan.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/secretdiaryofhan.wordpress.com/309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/secretdiaryofhan.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/secretdiaryofhan.wordpress.com/309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/secretdiaryofhan.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/secretdiaryofhan.wordpress.com/309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/secretdiaryofhan.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/secretdiaryofhan.wordpress.com/309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/secretdiaryofhan.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/secretdiaryofhan.wordpress.com/309/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=secretdiaryofhan.wordpress.com&amp;blog=2183720&amp;post=309&amp;subd=secretdiaryofhan&amp;ref=&amp;feed=1" width="1" height="1" /><div class="sharedaddy"></div>]]></content:encoded>
			<wfw:commentRss>http://secretdiaryofhan.wordpress.com/2008/02/02/including-remote-javascript-in-a-bookmarklet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f0bd4ed83708d0af0e0d1374fc7e605b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Han</media:title>
		</media:content>
	</item>
		<item>
		<title>Line No. in Rhino</title>
		<link>http://secretdiaryofhan.wordpress.com/2008/01/10/stack-trace-in-rhino/</link>
		<comments>http://secretdiaryofhan.wordpress.com/2008/01/10/stack-trace-in-rhino/#comments</comments>
		<pubDate>Thu, 10 Jan 2008 04:50:34 +0000</pubDate>
		<dc:creator>Han</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://secretdiaryofhan.wordpress.com/2008/01/10/stack-trace-in-rhino/</guid>
		<description><![CDATA[Rhino is a great tool for developing javascript code, since it comes with a shell that let&#8217;s you run scripts from the command line and provides a REPL loop for quick try-outs. The command line is kind of long and unfriendly, but this can be taken care of with an alias or shell script: java [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=secretdiaryofhan.wordpress.com&amp;blog=2183720&amp;post=308&amp;subd=secretdiaryofhan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.mozilla.org/rhino/">Rhino</a> is a great tool for developing javascript code, since it comes with a <a href="http://" title="http://developer.mozilla.org/en/docs/Rhino_Shell">shell</a> that let&#8217;s you run scripts from the command line and provides a <a href="http://en.wikipedia.org/wiki/REPL">REPL</a> loop for quick try-outs. The command line is kind of long and unfriendly, but this can be taken care of with an alias or shell script:</p>
<pre>
java -classpath js.jar
    org.mozilla.javascript.tools.shell.Main  -f test.js</pre>
<p>However, if you run a script that bombs out with an exception, you don&#8217;t get any line information, just the plain exception message:</p>
<pre>
js: uncaught JavaScript runtime exception:
    TypeError: Cannot call method "charCodeAt" of undefined</pre>
<p>To get line information, you need to ensure that rhino runs in interpretive mode, using the -opt -1 option:</p>
<pre>
java -classpath js.jar
    org.mozilla.javascript.tools.shell.Main -opt -1 -f test.js</pre>
<p>This results in:</p>
<pre>
js: "test.js", line 577: uncaught JavaScript runtime exception:
    TypeError: Cannot call method "charCodeAt" of undefined</pre>
<p>which has the offending line number, and thus is much more helpful. In addition, it it possible to get a stacktrace by invoking your code in a try catch block, and handling the exception as follows:</p>
<pre class="brush: jscript;">
try {
     // call your code here ...
}
catch (exc) {
    print(exc);
    if (exc.rhinoException)
        exc.rhinoException.printStackTrace();
}</pre>
<p>Don&#8217;t forget to specify the -opt -1 flag, since otherwise you&#8217;ll only see java-level calls. Also, note that the &#8220;rhinoException&#8221; property is defined on Error objects only, so the object caught should be explicitly tested for it.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/secretdiaryofhan.wordpress.com/308/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/secretdiaryofhan.wordpress.com/308/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/secretdiaryofhan.wordpress.com/308/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/secretdiaryofhan.wordpress.com/308/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/secretdiaryofhan.wordpress.com/308/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/secretdiaryofhan.wordpress.com/308/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/secretdiaryofhan.wordpress.com/308/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/secretdiaryofhan.wordpress.com/308/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/secretdiaryofhan.wordpress.com/308/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/secretdiaryofhan.wordpress.com/308/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/secretdiaryofhan.wordpress.com/308/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/secretdiaryofhan.wordpress.com/308/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/secretdiaryofhan.wordpress.com/308/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/secretdiaryofhan.wordpress.com/308/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/secretdiaryofhan.wordpress.com/308/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/secretdiaryofhan.wordpress.com/308/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=secretdiaryofhan.wordpress.com&amp;blog=2183720&amp;post=308&amp;subd=secretdiaryofhan&amp;ref=&amp;feed=1" width="1" height="1" /><div class="sharedaddy"></div>]]></content:encoded>
			<wfw:commentRss>http://secretdiaryofhan.wordpress.com/2008/01/10/stack-trace-in-rhino/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f0bd4ed83708d0af0e0d1374fc7e605b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Han</media:title>
		</media:content>
	</item>
		<item>
		<title>Building readline 5.2 on OS X Leopard</title>
		<link>http://secretdiaryofhan.wordpress.com/2007/12/26/building-readline-52-on-os-x-leopard/</link>
		<comments>http://secretdiaryofhan.wordpress.com/2007/12/26/building-readline-52-on-os-x-leopard/#comments</comments>
		<pubDate>Wed, 26 Dec 2007 09:29:58 +0000</pubDate>
		<dc:creator>Han</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[readline leopard]]></category>

		<guid isPermaLink="false">http://secretdiaryofhan.wordpress.com/2007/12/26/building-readline-52-on-os-x-leopard/</guid>
		<description><![CDATA[Readline 5.2 does not build properly on OS X Leopard. It fails with a  -compatibility_version only allowed with -dynamiclib error. I ran into this problem when trying to build ruby, using GNU readline instead of the default editline. The problem is easily fixed though. Readline explicitly checks for the darwin version, but does not include [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=secretdiaryofhan.wordpress.com&amp;blog=2183720&amp;post=307&amp;subd=secretdiaryofhan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Readline 5.2 does not build properly on OS X Leopard. It fails with a  <code>-compatibility_version only allowed with -dynamiclib</code> error. I ran into this problem when trying to build ruby, using GNU readline instead of the default editline. The problem is easily fixed though. Readline explicitly checks for the darwin version, but does not include 9 (Leopard) in this check. Patch support/shobj-conf using the following:</p>
<pre class="brush: sql;"> --- support/shobj-conf	2007-12-26 18:30:46.000000000 +0900
+++ support/shobj-conf.new	2007-12-26 18:30:39.000000000 +0900
@@ -142,7 +142,7 @@
;;

# Darwin/MacOS X
-darwin8*)
+darwin89*)
SHOBJ_STATUS=supported
SHLIB_STATUS=supported

@@ -171,7 +171,7 @@
SHLIB_LIBSUFF='dylib'

case &quot;${host_os}&quot; in
-	darwin[78]*)	SHOBJ_LDFLAGS=''
+	darwin[789]*)	SHOBJ_LDFLAGS=''
SHLIB_XLDFLAGS='-dynamiclib -arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
;;
*)		SHOBJ_LDFLAGS='-dynamic'</pre>
<p>and rerun configure and make.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/secretdiaryofhan.wordpress.com/307/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/secretdiaryofhan.wordpress.com/307/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/secretdiaryofhan.wordpress.com/307/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/secretdiaryofhan.wordpress.com/307/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/secretdiaryofhan.wordpress.com/307/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/secretdiaryofhan.wordpress.com/307/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/secretdiaryofhan.wordpress.com/307/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/secretdiaryofhan.wordpress.com/307/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/secretdiaryofhan.wordpress.com/307/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/secretdiaryofhan.wordpress.com/307/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/secretdiaryofhan.wordpress.com/307/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/secretdiaryofhan.wordpress.com/307/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/secretdiaryofhan.wordpress.com/307/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/secretdiaryofhan.wordpress.com/307/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/secretdiaryofhan.wordpress.com/307/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/secretdiaryofhan.wordpress.com/307/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=secretdiaryofhan.wordpress.com&amp;blog=2183720&amp;post=307&amp;subd=secretdiaryofhan&amp;ref=&amp;feed=1" width="1" height="1" /><div class="sharedaddy"></div>]]></content:encoded>
			<wfw:commentRss>http://secretdiaryofhan.wordpress.com/2007/12/26/building-readline-52-on-os-x-leopard/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f0bd4ed83708d0af0e0d1374fc7e605b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Han</media:title>
		</media:content>
	</item>
		<item>
		<title>Ruby 1.9.0 released</title>
		<link>http://secretdiaryofhan.wordpress.com/2007/12/25/ruby-190-released/</link>
		<comments>http://secretdiaryofhan.wordpress.com/2007/12/25/ruby-190-released/#comments</comments>
		<pubDate>Tue, 25 Dec 2007 14:38:58 +0000</pubDate>
		<dc:creator>Han</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://secretdiaryofhan.wordpress.com/2007/12/25/ruby-190-released/</guid>
		<description><![CDATA[Ruby 1.9.0 has been released a few minutes ago. From the Changelog: Tue Dec 25 23:33:55 2007 Yukihiro Matsumoto * development version 1.9.0 released. As promised at Ruby Kaigi last summer, it was released on Christmas day (with almost half an hour to spare). Get it from subversion at http://svn.ruby-lang.org/repos/ruby/trunk Congratulations to Matz, Ko1, and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=secretdiaryofhan.wordpress.com&amp;blog=2183720&amp;post=306&amp;subd=secretdiaryofhan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Ruby 1.9.0 has been released a few minutes ago.</p>
<p>From the Changelog:</p>
<blockquote><p>Tue Dec 25 23:33:55 2007  Yukihiro Matsumoto</p>
<p>* development version 1.9.0 released.</p></blockquote>
<p>As promised at Ruby Kaigi last summer, it was released on Christmas day (with almost half an hour to spare).</p>
<p>Get it from subversion at http://svn.ruby-lang.org/repos/ruby/trunk</p>
<p>Congratulations to Matz, Ko1, and all others who worked hard to make this happen!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/secretdiaryofhan.wordpress.com/306/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/secretdiaryofhan.wordpress.com/306/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/secretdiaryofhan.wordpress.com/306/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/secretdiaryofhan.wordpress.com/306/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/secretdiaryofhan.wordpress.com/306/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/secretdiaryofhan.wordpress.com/306/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/secretdiaryofhan.wordpress.com/306/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/secretdiaryofhan.wordpress.com/306/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/secretdiaryofhan.wordpress.com/306/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/secretdiaryofhan.wordpress.com/306/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/secretdiaryofhan.wordpress.com/306/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/secretdiaryofhan.wordpress.com/306/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/secretdiaryofhan.wordpress.com/306/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/secretdiaryofhan.wordpress.com/306/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/secretdiaryofhan.wordpress.com/306/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/secretdiaryofhan.wordpress.com/306/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=secretdiaryofhan.wordpress.com&amp;blog=2183720&amp;post=306&amp;subd=secretdiaryofhan&amp;ref=&amp;feed=1" width="1" height="1" /><div class="sharedaddy"></div>]]></content:encoded>
			<wfw:commentRss>http://secretdiaryofhan.wordpress.com/2007/12/25/ruby-190-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f0bd4ed83708d0af0e0d1374fc7e605b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Han</media:title>
		</media:content>
	</item>
		<item>
		<title>Y combinator in Ruby 1.9</title>
		<link>http://secretdiaryofhan.wordpress.com/2007/12/20/y-combinator-in-ruby-19/</link>
		<comments>http://secretdiaryofhan.wordpress.com/2007/12/20/y-combinator-in-ruby-19/#comments</comments>
		<pubDate>Thu, 20 Dec 2007 11:56:57 +0000</pubDate>
		<dc:creator>Han</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://secretdiaryofhan.wordpress.com/2007/12/20/y-combinator-in-ruby-19/</guid>
		<description><![CDATA[Just for fun, Tom Moertel&#8217;s Y combinator in Ruby 1.9&#8242;s new lambda syntax:<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=secretdiaryofhan.wordpress.com&amp;blog=2183720&amp;post=305&amp;subd=secretdiaryofhan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Just for fun, Tom Moertel&#8217;s <a href="http://weblog.raganwald.com/2007/02/guest-blogger-tom-moertel-derives-y.html">Y combinator</a> in Ruby 1.9&#8242;s new lambda syntax:</p>
<pre class="brush: ruby;">
def y
  -&gt; (x) { x.(x) }.(
    -&gt; (f) { -&gt; (*args) { yield (f.(f)).(*args) } }
  )
end

fac = y { |rec| -&gt; (n) { n &lt; 2 ? 1 : n * rec.(n-1) } }

puts fac.(5)   # ==&gt; 120</pre>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/secretdiaryofhan.wordpress.com/305/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/secretdiaryofhan.wordpress.com/305/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/secretdiaryofhan.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/secretdiaryofhan.wordpress.com/305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/secretdiaryofhan.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/secretdiaryofhan.wordpress.com/305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/secretdiaryofhan.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/secretdiaryofhan.wordpress.com/305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/secretdiaryofhan.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/secretdiaryofhan.wordpress.com/305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/secretdiaryofhan.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/secretdiaryofhan.wordpress.com/305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/secretdiaryofhan.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/secretdiaryofhan.wordpress.com/305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/secretdiaryofhan.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/secretdiaryofhan.wordpress.com/305/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=secretdiaryofhan.wordpress.com&amp;blog=2183720&amp;post=305&amp;subd=secretdiaryofhan&amp;ref=&amp;feed=1" width="1" height="1" /><div class="sharedaddy"></div>]]></content:encoded>
			<wfw:commentRss>http://secretdiaryofhan.wordpress.com/2007/12/20/y-combinator-in-ruby-19/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f0bd4ed83708d0af0e0d1374fc7e605b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Han</media:title>
		</media:content>
	</item>
		<item>
		<title>Code size, code complexity and constraints</title>
		<link>http://secretdiaryofhan.wordpress.com/2007/12/20/code-size-code-complexity-and-constraints/</link>
		<comments>http://secretdiaryofhan.wordpress.com/2007/12/20/code-size-code-complexity-and-constraints/#comments</comments>
		<pubDate>Thu, 20 Dec 2007 10:54:24 +0000</pubDate>
		<dc:creator>Han</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://secretdiaryofhan.wordpress.com/2007/12/20/code-size-code-complexity-and-constraints/</guid>
		<description><![CDATA[ Steve Yegge discusses code size or &#8220;bloat&#8221; as the ultimate bad property of code. Size Size and bloat hamper the requirement for a programmer to get a piece of code fully into his or her head, to be able fully understand it and to grasp the consequences of changes to that code. Steve&#8217;s focus is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=secretdiaryofhan.wordpress.com&amp;blog=2183720&amp;post=304&amp;subd=secretdiaryofhan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p> Steve Yegge <a href="http://steve-yegge.blogspot.com/2007/12/codes-worst-enemy.html">discusses</a> code size or &#8220;bloat&#8221; as the ultimate bad property of code.</p>
<h3>Size</h3>
<p>Size and bloat hamper the requirement for a programmer to get a piece of code fully into his or her head, to be able fully understand it and to grasp the consequences of changes to that code.</p>
<p>Steve&#8217;s focus is on how a language (Java in his case) promotes an increasing code size and how choosing a different language can reduce that size by maybe a factor 2 or 3 or so. Using a more expressive language frees a programmer from writing many lines of tedious, repetitive code. By being able to focus more on the problem at hand, the code&#8217;s intention can stand out more clearly as well, which further improves understandability.</p>
<p>Language is certainly a factor, but I&#8217;m fairly sure Steve would concur that there is more to it.</p>
<h3>Complexity</h3>
<p>For one thing, it is not code size per se, but something that is often strongly related to size that wreaks havoc on the understandability of a code base: code complexity.</p>
<p>Code complexity is often taken to be the ease or difficulty of understanding a simple piece of code that implements some common algorithm. Like the implementation of Quicksort in <a href="http://www.codecodex.com/wiki/index.php?title=Quicksort#Haskell">Haskell</a> versus <a href="http://www.codecodex.com/wiki/index.php?title=Quicksort#Java">Java</a>. That is not the complexity I am talking about. The complexity that makes programs hard to understand play at a somewhat higher level. In order to achieve its goals, various parts of a program have to interact. All but the most trivial programs contain many parts that must communicate. A lot of the complexity of code is holed up in the countless ways parts of a program talk to each other and influence each other. It is this dynamic complexity that makes things hard to understand.</p>
<p>Over the years, many methodologies were invented to better cope with the complexities of larger code bases. None have proven to be the silver bullet.</p>
<p>Object orientation, for example, is, in its essence, an attempt to better organize code in order to reign in some of its increasing complexity, by modeling entities into objects, and encapsulating their implementation while just showing a public interface to the rest of the program. It is beyond doubt that OO does somewhat help to keep a tab on complexity. But it only works to certain level, and there are certain characteristic of OO that, at some point, can be seen as making things worse. For example, it is not always a good idea to hide the implementation behind an interface. It is, for example, well established by now that it is bad practice to hide the fact that an object is local, or at the far side of a network.</p>
<p>More fundamentally, objects can, and very often do, keep a state. Objects interact, and calling an object&#8217;s methods often changes its state. By giving objects public methods that can change its state, a programmer is effectively creating a protocol for interacting with the object. Sometimes certain methods have to be called in a certain order, or after a certain other method has been called at some point beforehand. A program then, consists of numerous objects of different classes, calling each other, following many different protocols, whose outcome and effect may be different depending on the state objects were in to begin with.</p>
<p>A programmer reading through a code base must try to grasp these protocols, and try to reconstruct how objects interact. This is hard. OO allows us to create boundless implicit protocols and stateful objects, but gives us few tools to cope with the dynamism of a running program. It&#8217;s hard to see how this promotes understandability.</p>
<h3>Constraints</h3>
<p>So, what can be done to reduce complexity?</p>
<p>When the complexity of a program gets out of hand, it may be a sign that there are too many degrees of freedom in its design. And the answer to that is to add constraints. Constraints can be added at various levels and in various ways. Below are a few examples.</p>
<ul>
<li>For example we can drastically reduce the number of protocols allowed on objects. An example of this is REST. But even within a single executable, having only a few well defined ways for objects to communicate can be a great benefit. At first, this architectural style may seem limiting. However, putting in place the right set of constraints forces a developer to think a design through more deeply and ultimately may lead to a better solution. A solution, that has fewer surprises and a less steep learning curve for newcomers to the code, as it adheres to a set of well defined expectations. In addition, constraints at this level, can lead to substantial architectural benefits at higher levels.</li>
<li>As another example, without any constraints in place, arbitrary objects in a large program may call a public method on other objects far away in a different corner of the program. Having unbounded links between various parts of a large program greatly increases difficulty of understanding. However, depending on the nature of the program, it may be possible to establish, for example, a simple publish and subscribe mechanism of events, so that certain objects are constraint to raise events if their state changes, instead of directly calling methods on other objects, and others, quite independently react to the occurrence of such an event. The objects are decoupled, and the programmer trying to understand the dynamics will have a much easier job.</li>
<li>Avoiding to store state in objects or systems can also increase understandability. Functional programming languages have seen an amazing rise in popularity in the last few years, even though they have been around since the earliest times. This can be understood, in a way, as a reaction to object orientation. Side effect free functions have many benefits, not the least of which is understandability. Explicitly passing state around, instead of hiding it in objects and changing it as side effects of methods can make things far easier to comprehend. In addition, it comes with fringe benefits involving concurrency and scalability.</li>
<li>Breaking up programs in smaller parts makes it harder for those parts to communicate. Certain things, that are easy if those parts were in the same memory space are suddenly much harder to accomplish. In general, this will lead to communications becoming less fine-grained. If the boundaries at which to break up a big program in smaller ones are chosen right, this may again lead to less complex, less subtle code. As a result, the now independent parts can often be simplified considerably, having to focus on a more restricted, specialized subset. Understanding the broken up parts may be a lot easier than trying to grasp a big monolithic block of code.</li>
</ul>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/secretdiaryofhan.wordpress.com/304/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/secretdiaryofhan.wordpress.com/304/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/secretdiaryofhan.wordpress.com/304/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/secretdiaryofhan.wordpress.com/304/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/secretdiaryofhan.wordpress.com/304/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/secretdiaryofhan.wordpress.com/304/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/secretdiaryofhan.wordpress.com/304/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/secretdiaryofhan.wordpress.com/304/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/secretdiaryofhan.wordpress.com/304/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/secretdiaryofhan.wordpress.com/304/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/secretdiaryofhan.wordpress.com/304/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/secretdiaryofhan.wordpress.com/304/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/secretdiaryofhan.wordpress.com/304/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/secretdiaryofhan.wordpress.com/304/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/secretdiaryofhan.wordpress.com/304/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/secretdiaryofhan.wordpress.com/304/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=secretdiaryofhan.wordpress.com&amp;blog=2183720&amp;post=304&amp;subd=secretdiaryofhan&amp;ref=&amp;feed=1" width="1" height="1" /><div class="sharedaddy"></div>]]></content:encoded>
			<wfw:commentRss>http://secretdiaryofhan.wordpress.com/2007/12/20/code-size-code-complexity-and-constraints/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f0bd4ed83708d0af0e0d1374fc7e605b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Han</media:title>
		</media:content>
	</item>
		<item>
		<title>Perl 5.10 released on it&#8217;s 20th birthday</title>
		<link>http://secretdiaryofhan.wordpress.com/2007/12/20/perl-510-released-on-its-20th-birthday/</link>
		<comments>http://secretdiaryofhan.wordpress.com/2007/12/20/perl-510-released-on-its-20th-birthday/#comments</comments>
		<pubDate>Wed, 19 Dec 2007 15:37:56 +0000</pubDate>
		<dc:creator>Han</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://secretdiaryofhan.wordpress.com/2007/12/20/perl-510-released-on-its-20th-birthday/</guid>
		<description><![CDATA[Perl turned 20 on December 18th. Happy birthday! More than five years have passed between 5.8 and 5.10. I&#8217;m pretty sure 5.10 was never planned though. A huge amount of effort has gone into the still elusive Perl 6. But who knows when it will be released*. Meanwhile, time has passed, other languages have caught [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=secretdiaryofhan.wordpress.com&amp;blog=2183720&amp;post=303&amp;subd=secretdiaryofhan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Perl turned 20 on December 18th. Happy birthday!</p>
<p>More than five years have passed between <a href="http://dev.perl.org/perl5/news/2002/07/18/580ann/">5.8</a> and 5.10. I&#8217;m pretty sure 5.10 was never planned though. A huge amount of effort has gone into the still elusive <a href="http://www.perlfoundation.org/perl6/index.cgi">Perl 6</a>. But who knows when it will be released*. Meanwhile, time has passed, other languages have caught up, and an evolutionary step was in order. Some of the new features (<a href="http://search.cpan.org/~rgarcia/perl-5.10.0-RC2/pod/perl5100delta.pod">see here</a> for much more):</p>
<ul>
<li>Regular expression Improvements
<ul>
<li>Named matching groups in regexes (from C#)</li>
<li>Recursive patterns (In an attempt to make them Turing complete?)</li>
<li>Possessive quantifiers (/C++/ takes on a wholy different meaning&#8230;.)</li>
</ul>
</li>
<li>A switch like statement (&#8220;given&#8221;) with a smart match operator (a la Ruby)</li>
<li>Static variables (C style)</li>
<li>The new // (defined-or) operator</li>
</ul>
<p>*When Matz was asked, at the 2007 Ruby Kaigi, when Ruby 2 will be released, his <a href="http://jp.rubyist.net/RubyKaigi2007/?Log0609-S2">answer</a> was &#8220;Two years after Perl 6&#8243;.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/secretdiaryofhan.wordpress.com/303/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/secretdiaryofhan.wordpress.com/303/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/secretdiaryofhan.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/secretdiaryofhan.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/secretdiaryofhan.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/secretdiaryofhan.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/secretdiaryofhan.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/secretdiaryofhan.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/secretdiaryofhan.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/secretdiaryofhan.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/secretdiaryofhan.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/secretdiaryofhan.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/secretdiaryofhan.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/secretdiaryofhan.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/secretdiaryofhan.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/secretdiaryofhan.wordpress.com/303/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=secretdiaryofhan.wordpress.com&amp;blog=2183720&amp;post=303&amp;subd=secretdiaryofhan&amp;ref=&amp;feed=1" width="1" height="1" /><div class="sharedaddy"></div>]]></content:encoded>
			<wfw:commentRss>http://secretdiaryofhan.wordpress.com/2007/12/20/perl-510-released-on-its-20th-birthday/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f0bd4ed83708d0af0e0d1374fc7e605b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Han</media:title>
		</media:content>
	</item>
		<item>
		<title>Ginza super cluster</title>
		<link>http://secretdiaryofhan.wordpress.com/2007/12/13/star-density/</link>
		<comments>http://secretdiaryofhan.wordpress.com/2007/12/13/star-density/#comments</comments>
		<pubDate>Thu, 13 Dec 2007 11:30:53 +0000</pubDate>
		<dc:creator>Han</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://secretdiaryofhan.wordpress.com/2007/12/13/star-density/</guid>
		<description><![CDATA[Michelin recently handed out stars to 150 Tokyo restaurants. Now Tokyo is a big city, but around 30 or so of the chosen places are in Ginza, in an area that is barely half a square km (0.2 sq miles). That makes for an interesting density map (via open-log.net). Note the three 3-star restaurants withing [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=secretdiaryofhan.wordpress.com&amp;blog=2183720&amp;post=301&amp;subd=secretdiaryofhan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Michelin <a href="http://www.guardian.co.uk/g2/story/0,,2214462,00.html">recently</a> handed out stars to <a href="http://www.michelinmedia.com/pressSingle/value=MCH2007111952432">150 Tokyo restaurants</a>. Now Tokyo is a <a href="http://en.wikipedia.org/wiki/List_of_metropolitan_areas_by_population">big city</a>, but around 30 or so of the chosen places are in Ginza, in an area that is barely half a square km (0.2 sq miles). That makes for an interesting density map (via <a href="http://maps.open-log.net/michelin/">open-log.net</a>). Note the three 3-star restaurants withing spitting distance at the left.<img src="http://secretdiaryofhan.files.wordpress.com/2007/12/picture-4.png?w=700&#038;h=350" alt="Map of Ginza with Michelin star overlay" height="350" width="700" /></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/secretdiaryofhan.wordpress.com/301/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/secretdiaryofhan.wordpress.com/301/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/secretdiaryofhan.wordpress.com/301/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/secretdiaryofhan.wordpress.com/301/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/secretdiaryofhan.wordpress.com/301/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/secretdiaryofhan.wordpress.com/301/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/secretdiaryofhan.wordpress.com/301/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/secretdiaryofhan.wordpress.com/301/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/secretdiaryofhan.wordpress.com/301/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/secretdiaryofhan.wordpress.com/301/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/secretdiaryofhan.wordpress.com/301/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/secretdiaryofhan.wordpress.com/301/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/secretdiaryofhan.wordpress.com/301/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/secretdiaryofhan.wordpress.com/301/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/secretdiaryofhan.wordpress.com/301/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/secretdiaryofhan.wordpress.com/301/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=secretdiaryofhan.wordpress.com&amp;blog=2183720&amp;post=301&amp;subd=secretdiaryofhan&amp;ref=&amp;feed=1" width="1" height="1" /><div class="sharedaddy"></div>]]></content:encoded>
			<wfw:commentRss>http://secretdiaryofhan.wordpress.com/2007/12/13/star-density/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f0bd4ed83708d0af0e0d1374fc7e605b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Han</media:title>
		</media:content>

		<media:content url="http://secretdiaryofhan.files.wordpress.com/2007/12/picture-4.png" medium="image">
			<media:title type="html">Map of Ginza with Michelin star overlay</media:title>
		</media:content>
	</item>
	</channel>
</rss>
