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

<channel>
	<title>//extrabright &#187; geek</title>
	<atom:link href="http://extrabright.com/blog/category/geek/feed/" rel="self" type="application/rss+xml" />
	<link>http://extrabright.com/blog</link>
	<description>//pat&#039;s blog</description>
	<lastBuildDate>Sat, 10 Jul 2010 19:11:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Scala Question Regarding readLine</title>
		<link>http://extrabright.com/blog/2010/07/10/scala-question-regarding-readline/</link>
		<comments>http://extrabright.com/blog/2010/07/10/scala-question-regarding-readline/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 19:11:13 +0000</pubDate>
		<dc:creator>pajai</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[pat]]></category>
		<category><![CDATA[scala]]></category>

		<guid isPermaLink="false">http://extrabright.com/blog/?p=262</guid>
		<description><![CDATA[I have stumbled upon a weirdness regarding the behavior of readLine in Scala (at least with my current basic understanding of the language).
The following snippet is supposed to read three times a line from standard in. But it reads 3 times the same line (the first).

(1 to 3) foreach {
  val line = Console.readLine
 [...]]]></description>
			<content:encoded><![CDATA[<p>I have stumbled upon a weirdness regarding the behavior of readLine in Scala (at least with my current basic understanding of the language).</p>
<p>The following snippet is supposed to read three times a line from standard in. But it reads 3 times the same line (the first).
<pre>
(1 to 3) foreach {
  val line = Console.readLine
  i => println(line)
}
</pre>
<p>while the following snippet (very similar) behaves as expected (reading the three first line from stdin):
<pre>
(1 to 3) foreach {
  i => println(Console.readLine)
}
</pre>
<p>Any idea why?</p>
]]></content:encoded>
			<wfw:commentRss>http://extrabright.com/blog/2010/07/10/scala-question-regarding-readline/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Java Quiz of the Day</title>
		<link>http://extrabright.com/blog/2010/05/22/java-quiz-of-the-day-2/</link>
		<comments>http://extrabright.com/blog/2010/05/22/java-quiz-of-the-day-2/#comments</comments>
		<pubDate>Sat, 22 May 2010 21:12:54 +0000</pubDate>
		<dc:creator>pajai</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[pat]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[quiz]]></category>

		<guid isPermaLink="false">http://extrabright.com/blog/?p=250</guid>
		<description><![CDATA[Java quiz of the day (easy): what gives

Object[] a = new Integer[]{};
List&#60;Object&#62; b = new ArrayList&#60;Integer&#62;();

Response: we get an exception on the second line:

Type mismatch: cannot convert from ArrayList&#60;Integer&#62; to List&#60;Object&#62;

Arrays and Generics are not consistent. While for arrays, an array of some type is also an array of one of its parent types, the [...]]]></description>
			<content:encoded><![CDATA[<p>Java quiz of the day (easy): what gives<br />
<code><br />
Object[] a = new Integer[]{};<br />
List&lt;Object&gt; b = new ArrayList&lt;Integer&gt;();<br />
</code></p>
<p><strong>Response</strong>: we get an exception on the second line:<br />
<code><br />
Type mismatch: cannot convert from ArrayList&lt;Integer&gt; to List&lt;Object&gt;<br />
</code></p>
<p>Arrays and Generics are not consistent. While for arrays, an array of some type is also an array of one of its parent types, the same is not true for Generics. If it was, we could construct weird things where we would get at most a runtime exception when trying to access items of a collection. See the following example:</p>
<pre>
class A{
	void foo(List<Integer> list) {
		List<Object> otherList = list; // (A)
		otherList.add("hi"); // (B)
	}
}

List<Integer> list = new ArrayList<Integer>();
list.add(5);
new A().foo(list);
for (Integer i : list) {
	System.out.println(i.intValue()); // (C)
}
</pre>
<p>Here line (A) is not a legal assignment. If it was, then we could insert into our originally List<Integer> a String on line (B). Then back from our method foo, we would get a runtime exception when processing the list on line (C). This problem was fixed for Generics, while similar problems exist for arrays.</p>
]]></content:encoded>
			<wfw:commentRss>http://extrabright.com/blog/2010/05/22/java-quiz-of-the-day-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Java Quiz of the Day II</title>
		<link>http://extrabright.com/blog/2010/05/19/java-quiz-of-the-day-ii/</link>
		<comments>http://extrabright.com/blog/2010/05/19/java-quiz-of-the-day-ii/#comments</comments>
		<pubDate>Wed, 19 May 2010 19:02:47 +0000</pubDate>
		<dc:creator>pajai</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[pat]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[quiz]]></category>

		<guid isPermaLink="false">http://extrabright.com/blog/?p=247</guid>
		<description><![CDATA[What gives:

Integer a = 100, b = 100;
Integer c = 200, d = 200;
System.out.println( (a == b) == (c == d) ); // A

Response: counter intuitively, the program prints &#8216;false&#8217; out. Integer in Java is a non-native class, where &#8216;==&#8217; means &#8216;reference equality&#8217; (two variables are reference equal if they are pointing to the same [...]]]></description>
			<content:encoded><![CDATA[<p>What gives:<br />
<code><br />
Integer a = 100, b = 100;<br />
Integer c = 200, d = 200;<br />
System.out.println( (a == b) == (c == d) ); // A<br />
</code></p>
<p><strong>Response</strong>: counter intuitively, the program prints &#8216;false&#8217; out. Integer in Java is a non-native class, where &#8216;==&#8217; means &#8216;reference equality&#8217; (two variables are reference equal if they are pointing to the same object). From there we would expect the expression of line (A) to be reduced to &#8216;false == false&#8217;, but it is slightly more complicated: the Integer class has the particularity that all Integer (like Short) in the range [-128, 127] are shared. This means the two variables &#8216;a&#8217; and &#8216;b&#8217; are actually pointing to the same shared object. Hence the expression of line (A) is in fact reduced to &#8216;true == false&#8217;.</p>
]]></content:encoded>
			<wfw:commentRss>http://extrabright.com/blog/2010/05/19/java-quiz-of-the-day-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java Quiz of the Day</title>
		<link>http://extrabright.com/blog/2010/05/19/java-quiz-of-the-day/</link>
		<comments>http://extrabright.com/blog/2010/05/19/java-quiz-of-the-day/#comments</comments>
		<pubDate>Wed, 19 May 2010 18:47:48 +0000</pubDate>
		<dc:creator>pajai</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[pat]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[quiz]]></category>

		<guid isPermaLink="false">http://extrabright.com/blog/?p=242</guid>
		<description><![CDATA[What gives

Double a = null;
Double b = a == null ? a : 1.0;

Response: as strange as it can seem at first look, b is not equal to null after the second statement, but the code produces a NullPointerException. 
The reason for that is the type of the second expression (double) inside the ternery operator. [...]]]></description>
			<content:encoded><![CDATA[<p>What gives<br />
<code><br />
Double a = null;<br />
Double b = a == null ? a : 1.0;<br />
</code></p>
<p><strong>Response</strong>: as strange as it can seem at first look, b is not equal to null after the second statement, but the code produces a NullPointerException. </p>
<p>The reason for that is the type of the second expression (double) inside the ternery operator. The first expression &#8216;a&#8217; of type Double is unboxed to double (calling doubleValue() on &#8216;a&#8217; which is null), causing the NPE.</p>
<p>You can find a discussion about that <a href="http://stackoverflow.com/questions/2615498/java-conditional-operator-result-type">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://extrabright.com/blog/2010/05/19/java-quiz-of-the-day/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sparse Files &#8211; Commands Overview</title>
		<link>http://extrabright.com/blog/2010/03/31/sparse-files-commands-overview/</link>
		<comments>http://extrabright.com/blog/2010/03/31/sparse-files-commands-overview/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 15:36:22 +0000</pubDate>
		<dc:creator>pajai</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[pat]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[sparse]]></category>

		<guid isPermaLink="false">http://extrabright.com/blog/?p=228</guid>
		<description><![CDATA[I was just checking which commands are supporting sparse files. I post hereafter a short overview of what I found out (working on Linux).

Create a sparse file of 20 GiB:
        dd if=/dev/zero of=foo bs=1 count=1 seek=20G

Check that a file is sparse:
        [...]]]></description>
			<content:encoded><![CDATA[<p>I was just checking which commands are supporting sparse files. I post hereafter a short overview of what I found out (working on Linux).</p>
<ul>
<li>Create a sparse file of 20 GiB:<br />
        <code>dd if=/dev/zero of=foo bs=1 count=1 seek=20G</code></p>
</li>
<li>Check that a file is sparse:<br />
        <code>ls -alsh</code><br />
Compare the first versus second size column (the first one is the space taken on disk).</p>
</li>
<li>Copy a sparse file:<br />
        <code>cp foo bar</code><br />
Copy already detects and handles correctly sparse files.</p>
</li>
<li>Make a non-sparse file sparse (works only if it contains blocks filled with zeros):<br />
        <code>cp --sparse=always foo bar</code></p>
</li>
<li>Expand a sparse file to a non-sparse one:<br />
        <code>cp --sparse=never foo bar</code></p>
</li>
<li>Copy remotely a sparse file: scp does not support sparse files, it will expand them to non-sparse ones. Rsync does support them. Just use the <code>-S</code> or <code>--sparse</code> option. Example:<br />
        <code>rsync -vS foo root@someserver:/some/path/</code></li>
]]></content:encoded>
			<wfw:commentRss>http://extrabright.com/blog/2010/03/31/sparse-files-commands-overview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Know if a File on Linux is Sparse?</title>
		<link>http://extrabright.com/blog/2010/03/30/how-to-know-if-a-file-on-linux-is-sparse/</link>
		<comments>http://extrabright.com/blog/2010/03/30/how-to-know-if-a-file-on-linux-is-sparse/#comments</comments>
		<pubDate>Tue, 30 Mar 2010 19:44:34 +0000</pubDate>
		<dc:creator>pajai</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[general]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[pat]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[sparse]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://extrabright.com/blog/?p=221</guid>
		<description><![CDATA[A sparse file is a file which does not take more space on disk than needed. Such a file is usually used to store a partition image on disk, for instance with a virtualization solution like Xen.
It&#8217;s super easy, to know if a file is sparse or not. Just use the &#8217;s&#8217; option of ls.
ls [...]]]></description>
			<content:encoded><![CDATA[<p>A sparse file is a file which does not take more space on disk than needed. Such a file is usually used to store a partition image on disk, for instance with a virtualization solution like Xen.</p>
<p>It&#8217;s super easy, to know if a file is sparse or not. Just use the &#8217;s&#8217; option of ls.</p>
<p><code>ls -alsh</code></p>
<p>will yield:<br />
<code><br />
4.0K drwxr-xr-x  9 root root 4.0K 2010-03-23 18:22 .<br />
4.0K drwxr-xr-x 23 root root 4.0K 2009-01-09 19:47 ..<br />
 12G -rw-r-----  1 root root  24G 2007-01-10 19:55 dompat.data<br />
3.7G -rw-r--r--  1 root root 7.1G 2009-01-06 21:09 dompat-hardy.sys<br />
501M -rw-r-----  1 root root 501M 2007-01-07 16:40 dompat.swap<br />
</code></p>
<p>Where the first size column is the effective space taken on disk while the second size column is the max space of that file. We see that <code>dompat.data</code> is sparse, since its max size is 24 GB while it takes only 12 GB on disk.</p>
<p>References</p>
<ul>
<li>More information on command which can handle sparse files in <a href="http://administratosphere.wordpress.com/2008/05/23/sparse-files-what-why-and-how/">this article</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://extrabright.com/blog/2010/03/30/how-to-know-if-a-file-on-linux-is-sparse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GPGMail Compatible with Snow Leopard</title>
		<link>http://extrabright.com/blog/2010/03/28/gpgmail-compatible-with-snow-leopard/</link>
		<comments>http://extrabright.com/blog/2010/03/28/gpgmail-compatible-with-snow-leopard/#comments</comments>
		<pubDate>Sun, 28 Mar 2010 16:32:22 +0000</pubDate>
		<dc:creator>pajai</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[pat]]></category>
		<category><![CDATA[gpg]]></category>
		<category><![CDATA[gpgmail]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://extrabright.com/blog/?p=217</guid>
		<description><![CDATA[I had posted that some times ago on Twitter. There is a new version of the excellent GPGMail plug-in for Mail (OS X). Grab it, if you haven&#8217;t already.
GPGMail for OS X 10.6.2
Just put it inside ~/Library/Mail/Bundles and restart Mail. (More information on GPGMail&#8217;s web page.)
Edit: This is not an official version of GPGMail. There [...]]]></description>
			<content:encoded><![CDATA[<p>I had posted that some times ago on Twitter. There is a new version of the excellent GPGMail plug-in for Mail (OS X). Grab it, if you haven&#8217;t already.</p>
<p><a href="http://dl.dropbox.com/u/20215/GPGMail.mailbundle-10.6.2.zip">GPGMail for OS X 10.6.2</a></p>
<p>Just put it inside ~/Library/Mail/Bundles and restart Mail. (More information on <a href="http://www.sente.ch/software/GPGMail/English.lproj/GPGMail.html#Installation">GPGMail&#8217;s web page</a>.)</p>
<p>Edit: This is not an official version of GPGMail. There is still no official version of GPGMail compatible with Snow Leopard.</p>
]]></content:encoded>
			<wfw:commentRss>http://extrabright.com/blog/2010/03/28/gpgmail-compatible-with-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>NFS Automount with Snow Leopard</title>
		<link>http://extrabright.com/blog/2009/11/15/nfs-automount-with-snow-leopard/</link>
		<comments>http://extrabright.com/blog/2009/11/15/nfs-automount-with-snow-leopard/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 16:57:54 +0000</pubDate>
		<dc:creator>pajai</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[pat]]></category>

		<guid isPermaLink="false">http://extrabright.com/blog/?p=203</guid>
		<description><![CDATA[Before upgrading to Snow Leopard, I was using the NFS automount capability of Mac OS X. It was a handy way for my laptop to connect to my home NAS server (a linux box running Ubuntu).
Unfortunately I had to redo the NFS config after upgrading and I noticed that Directory Utility was not present anymore [...]]]></description>
			<content:encoded><![CDATA[<p>Before upgrading to Snow Leopard, I was using the NFS automount capability of Mac OS X. It was a handy way for my laptop to connect to my home NAS server (a linux box running Ubuntu).</p>
<p>Unfortunately I had to redo the NFS config after upgrading and I noticed that Directory Utility was not present anymore in Snow Leopard.</p>
<p>Here is what I found out after some research:</p>
<li>the NFS automount configuration is now done directly in Disk Utility (under File > NFS Mounts&#8230;) and not in Directory Utility like in Leopard (which does not exist anymore).</li>
<li>the configuration that worked for me was the following one (for accessing a read-write NFS share):
<pre>
Remote NFS URL: nfs://[server]/[path]
Mount location: [path to local mount folder]
Advanced Mount Parameters: -i,-s,-w=32768,-r=32768
</pre>
</li>
<li> for automount to reload its configuration, I had to run the following command:
<pre>sudo automount -vc</pre>
</li>
<p>That&#8217;s it. The NFS share should now be accessible.</p>
<p>References:</p>
<li><a href="http://discussions.apple.com/thread.jspa?threadID=2137675">http://discussions.apple.com/thread.jspa?threadID=2137675</a></li>
]]></content:encoded>
			<wfw:commentRss>http://extrabright.com/blog/2009/11/15/nfs-automount-with-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Time Machine: Handy but Bitchy!</title>
		<link>http://extrabright.com/blog/2009/06/30/time-machine-handy-but-bitchy/</link>
		<comments>http://extrabright.com/blog/2009/06/30/time-machine-handy-but-bitchy/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 21:10:12 +0000</pubDate>
		<dc:creator>pajai</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[pat]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[timemachine]]></category>

		<guid isPermaLink="false">http://extrabright.com/blog/?p=183</guid>
		<description><![CDATA[I have been spending the last couple of days of my spare time performing a simple operation with my mac, yet slightly more complicated than expected: merge the two partitions of my hard drive into one. This was necessary since I did a mapping, quite usual on Linux, where my system was sitting on the [...]]]></description>
			<content:encoded><![CDATA[<p>I have been spending the last couple of days of my spare time performing a simple operation with my mac, yet slightly more complicated than expected: merge the two partitions of my hard drive into one. This was necessary since I did a mapping, quite usual on Linux, where my system was sitting on the first partition (50 GB) while my user data was on the second one (the rest of 300 GB). But this mapping was not making me happy, since the system partition was always almost full (Mac OS X is not well suited for a multi partition disk drive, I find).</p>
<p>Although you can resize a live partition with Disk Utility (great feature, even if you booted with it), you cannot move the base position of a partition. You can merely resize it, if more space is available. So I had to back my second partition up for later restoring it. I went for Time Machine, since I was already using it for backing up my laptop.</p>
<h3>Time Machine Caveats</h3>
<p>Unfortunetely I noticed a couple of caveats during the restore operation:</p>
<li>When using the Time Machine restore utility shipped with the OS X install DVD, you can only restore the partition where the system is, but not other ones. This was quite of a surpise to me. Although you can choose on which partition you want to restore your system (the target, not the source).</li>
<li>Although your data is actually sitting on the Time Machine backup drive, you cannot use it directly (i.e. copy it back using the Finder or a shell). The reason for that is the ACLs that Leopard is putting on each and every file and folder to protect changing the Time Machine backup. In addition the ACL system (which is a parralel access control to the Unix one, which I did not know the existence of beforehand) is deeply flawed: you cannot reliably remove recursively the ACLs from a directory structure (you will still find files scattered within the structure having ACLs) and you even cannot remove the ACL permissions on symbolic links (this seems to be a bug of chmod on Leopard, although ACLs on a symlink do not seem to have any effect)</li>
<h3>Solution for merging two partitions</h3>
<p>I finally found a solution to restore the second partition or to merge them: I had to fiddle directly with the Time Machine backup, copying manually the files I wanted from the second partition to the first, and did a restore of the first partition using Time Machine restore utility.</p>
<p>Here are the details of the steps I took:</p>
<li>Plug my external drive where I have my Time Machine backup, open a terminal and sudo as root:<br />
<code>sudo -s</code>
</li>
<li>Deactivate on that drive the ACL checks, so that I can modify directly the Time Machine backup:<br />
<code>fsaclctl -p /Volumes/[backup drive] -d</code>
</li>
<li>Move the folders from the second partition to the first one with<br />
<code>mv [from] [to]</code>
</li>
<li>Reactivate the ACL checks on the external drive:<br />
<code>fsaclctl -p /Volumes/[backup drive] -e</code>
</li>
<li>Do the restore of the first partition with the Time Machine restore utility (located on the Leopard install DVD).</li>
<p>This worked for me. You should now have a merged partition on your drive, the restore utility having removed the ACLs during the operation. Phew! This was not a straight forward action! I still cannot believe that Apple did not take into account that people can have more than 1 partition on their drive (I might still have missed the way to do it, did not find it so far though).</p>
<h3>Links/Info</h3>
<li><a href="http://www.macosxhints.com/article.php?story=20090213071015789">Macosxhint: reconnect Time Machine backup after a drive swap</a></li>
<li>Inspect the ACLs of your file with ls:<br />
<code>ls -le</code></p>
<p>For the record, this will yield the following listing when ACLs are present (pay attention to the lines starting with &#8216;0: &#8216; and &#8216;1: &#8216;:<br />
<code>drwxrwxr-x@ 138 root   admin  4692 Sep 13  2008 Applications<br />
 0: group:everyone deny add_file,delete,add_subdirectory,delete_child,writeattr,writeextattr,chown<br />
 1: group:everyone deny delete<br />
drwxr-xr-x@   2 pat    staff    68 May  9 22:12 DeveloperSDK3<br />
 0: group:everyone deny add_file,delete,add_subdirectory,delete_child,writeattr,writeextattr,chown<br />
drwxr-xr-x@   5 pat    staff   170 Oct 23  2008 VirtualBox<br />
 0: group:everyone deny add_file,delete,add_subdirectory,delete_child,writeattr,writeextattr,chown</code></p>
<p>You can also do that recursively using the following command:<br />
<code>ls -lateR > filelist</code>
</li>
<li>You can remove ACLs on a file with this command (not working properly for a recursive operation with the option <code>-R</code>)<br />
<code>chmod -a# 0 [file]</code><br />
where 0 is the ACL entry to remove.</p>
]]></content:encoded>
			<wfw:commentRss>http://extrabright.com/blog/2009/06/30/time-machine-handy-but-bitchy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Geekiest Hello World</title>
		<link>http://extrabright.com/blog/2009/06/11/the-geekiest-hello-world/</link>
		<comments>http://extrabright.com/blog/2009/06/11/the-geekiest-hello-world/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 17:55:32 +0000</pubDate>
		<dc:creator>pajai</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[pat]]></category>
		<category><![CDATA[geek groovy]]></category>

		<guid isPermaLink="false">http://extrabright.com/blog/?p=180</guid>
		<description><![CDATA[Folks, I think that I have found (one of) the geekiest hello world out there. Implemented in Groovy using the dynamic interception of method calls. Here it goes:

class Hello {
  Object invokeMethod(String name, Object arguments) {
    System.out.println "hello $name!"
  }
}

def hello = new Hello()
hello.john()
hello.you()

Which produce the following output:

hello john!
hello you!

I [...]]]></description>
			<content:encoded><![CDATA[<p>Folks, I think that I have found (one of) the geekiest hello world out there. Implemented in Groovy using the dynamic interception of method calls. Here it goes:</p>
<pre>
class Hello {
  Object invokeMethod(String name, Object arguments) {
    System.out.println "hello $name!"
  }
}

def hello = new Hello()
hello.john()
hello.you()
</pre>
<p>Which produce the following output:</p>
<pre>
hello john!
hello you!
</pre>
<p>I suppose the same mechanism can be used with Ruby (and some other dynamic languages).</p>
]]></content:encoded>
			<wfw:commentRss>http://extrabright.com/blog/2009/06/11/the-geekiest-hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
