<?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>Grayger</title>
	<atom:link href="http://www.grayger.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.grayger.com</link>
	<description>In the pursuit of effectiveness</description>
	<lastBuildDate>Fri, 12 Mar 2010 15:32:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>[New Game] Garbage Separator</title>
		<link>http://www.grayger.com/new-game-garbage-separator/</link>
		<comments>http://www.grayger.com/new-game-garbage-separator/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 00:53:46 +0000</pubDate>
		<dc:creator>grayger</dc:creator>
				<category><![CDATA[Game]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Garbage Separator]]></category>

		<guid isPermaLink="false">http://www.grayger.com/?p=310</guid>
		<description><![CDATA[I released a new game! Garbage Separator is a physics-based action game. You can control robot arms to throw garbage into bins. You will get new arms as you clear certain levels, and may use them in combination. 
 &#160; &#160;
Challenge 20 levels! I hope you enjoy this game. PLAY!

You can also play the game [...]]]></description>
			<content:encoded><![CDATA[<p>I released a new game! <a href="http://www.grayger.com/?page_id=296"><strong>Garbage Separator</strong></a> is a physics-based action game. You can control robot arms to throw garbage into bins. You will get new arms as you clear certain levels, and may use them in combination. </p>
<p><a href="http://www.grayger.com/wp-content/uploads/2010/01/level17.png"><img src="http://www.grayger.com/wp-content/uploads/2010/01/level17.png" alt="garbage_separator_level17" title="garbage_separator_level17" width="210" height="150"/></a> &nbsp;<a href="http://www.grayger.com/wp-content/uploads/2010/01/level181.png"><img src="http://www.grayger.com/wp-content/uploads/2010/01/level181.png" alt="garbage_separator_level18" title="garbage_separator_level18" width="210" height="150" /></a> &nbsp;<a href="http://www.grayger.com/wp-content/uploads/2010/01/level14.png"><img src="http://www.grayger.com/wp-content/uploads/2010/01/level14.png" alt="garbage_separator_level14" title="garbage_separator_level14" width="210" height="150" /></a></p>
<p>Challenge 20 levels! I hope you enjoy this game. <a href="http://www.grayger.com/?page_id=296"><strong>PLAY!</strong></h2>
<p></a></p>
<p>You can also play the game on <a href="http://www.kongregate.com/games/grayger/garbage-separator">kongregate</a>!</p>
<!-- AdSense Now! Redux V1.80 -->
<!-- Post[count: 2] -->
<div class="adsense adsense-leadout" style="text-align:center;margin: 12px;"><script type="text/javascript"><!--
google_ad_client = "pub-5743065732431244";
/* 728x90_1 */
google_ad_slot = "5507201624";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>]]></content:encoded>
			<wfw:commentRss>http://www.grayger.com/new-game-garbage-separator/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fire Special Effect in Python</title>
		<link>http://www.grayger.com/fire-effect/</link>
		<comments>http://www.grayger.com/fire-effect/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 13:55:29 +0000</pubDate>
		<dc:creator>grayger</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Numpy]]></category>
		<category><![CDATA[Pygame]]></category>

		<guid isPermaLink="false">http://www.grayger.com/wp/?p=184</guid>
		<description><![CDATA[I have interested in special effects these days, and bought a book &#8220;Special Effects Game Programming with DirectX&#8221; yesterday. The algorithm of fire effect looks simple. I want to compile and execute bundled source code that is implemented in C++, but it uses DirectX8 whereas my computer has only DirectX10 SDK installed. 
Implementing the algorithm [...]]]></description>
			<content:encoded><![CDATA[<p>I have interested in special effects these days, and bought a book &#8220;Special Effects Game Programming with DirectX&#8221; yesterday. The algorithm of fire effect looks simple. I want to compile and execute bundled source code that is implemented in C++, but it uses DirectX8 whereas my computer has only DirectX10 SDK installed. </p>
<p>Implementing the algorithm in Python was easy except creating a palette. I hadn&#8217;t understood how to &#8220;make&#8221; a palette, rather I thought palettes are provided by OS or libraries. <a href="http://www.pygame.org/pcr/numpy_flames/">The code from Pygame repository</a> that creates red-palette is good for me to understand how to make a palette.   </p>
<p>Anyway my code is as below</p>
<pre class="brush: python; ">

&#039;&#039;&#039;
Created on Nov 12, 2009

Class for fire special effect 

Dependency:
 numpy: http://numpy.scipy.org/
 pygame: http://pygame.org/

@author: grayger (http://www.grayger.com/)
&#039;&#039;&#039;

import random
import sys
import numpy
import pygame
from pygame.locals import *

class FireEffect:
    def __init__(self, size=(40, 40), coolingFactor=5, fuelRange=(-31, 32)):
        self.__width, self.__height = size
        self.coolingFactor = coolingFactor
        self.fuelRange = fuelRange

        self.__array = numpy.zeros((self.__width, self.__height))
        self.__fireSurface = pygame.Surface((self.__width, self.__height), 0, 8 )
        self.__fireSurface.set_palette(self.__getPalette())

        random.seed()

    def __getPalette(self):
        gstep, bstep = 75, 150
        cmap = numpy.zeros((256, 3))
        cmap[:, 0] = numpy.minimum(numpy.arange(256) * 3, 255)
        cmap[gstep:, 1] = cmap[:-gstep, 0]
        cmap[bstep:, 2] = cmap[:-bstep, 0]
        return cmap  

    def getFireSurface(self):
        tempArray = numpy.zeros(self.__array.shape)
        for r in range(0, self.__width):
            for c in range(0, self.__height):
                tempArray[r, max(0, c - 1)] = min(255, max(0, (int(self.__array[max(0, r - 1), c]) + int(self.__array[min(self.__width - 1, r + 1), c]) + int(self.__array[r, max(0, c - 1)]) + int(self.__array[r, min(self.__height - 1, c + 1)])) / 4 - self.coolingFactor))

        for r in range (0, self.__width, 2):
            fuel = min(255, max(0, self.__array[r, self.__height - 1] + random.randint(*self.fuelRange)))

            tempArray[r, self.__height - 1] = fuel
            tempArray[r + 1, self.__height - 1] = fuel

        self.__array = tempArray
        pygame.surfarray.blit_array(self.__fireSurface, self.__array.astype(&#039;int&#039;))
        return self.__fireSurface

#######################################

pygame.init()
screen = pygame.display.set_mode((320, 120), 0, 8 )
fireEffect = FireEffect()

clock = pygame.time.Clock()

while True:
    for event in pygame.event.get():
        if event.type == QUIT:
            pygame.quit()
            sys.exit()
        if event.type == KEYDOWN:
            if event.key == K_a and fireEffect.coolingFactor &lt; 10:
                fireEffect.coolingFactor += 1
            elif event.key == K_z and fireEffect.coolingFactor &gt; 1:
                fireEffect.coolingFactor -= 1

    fireSurface=fireEffect.getFireSurface()
    # draw the original fire image
    screen.blit(fireSurface, (0,0))    

    # draw the scaled and mirrored fire image
    pos = (0, 40)
    fireSurface = pygame.transform.scale(fireSurface, (80, 80))
    fireSurface2 = pygame.transform.flip(fireSurface, True, False)
    for i in range(0, 4, 2):
        screen.blit(fireSurface, (pos[0] + fireSurface.get_width()*i, pos[1]))
        screen.blit(fireSurface2, (pos[0] + fireSurface.get_width()*(i + 1), pos[1]))

    clock.tick(30)
    pygame.display.flip()

#######################################    
</pre>
<p>When creating a FireEffect instance, you can set the size of surface array, cooling factor, and the range of fuel factor. The bigger size requires more CPU resource but produces better quality. The bigger cooling factor, the shorter the fire height. The bigger fuel factor, the brighter the fire.<br />
<img src="http://www.grayger.com/wp-content/uploads/2009/11/fire2.png" alt="fire2" title="fire2" width="326" height="151" class="aligncenter size-full wp-image-199" /><br />
The upper image is original-sized one and the lower image is scaled/mirrored one.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.grayger.com/fire-effect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bit Hacks</title>
		<link>http://www.grayger.com/bit-hacks/</link>
		<comments>http://www.grayger.com/bit-hacks/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 08:39:06 +0000</pubDate>
		<dc:creator>grayger</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Pyglet]]></category>

		<guid isPermaLink="false">http://www.grayger.com/wp/?p=169</guid>
		<description><![CDATA[I found a short code from pyglet source code. 


def _is_pow2(v):
    # http://graphics.stanford.edu/~seander/bithacks.html#DetermineIfPowerOf2
    return (v &#38; (v - 1)) == 0

At a glance, I can understand how it works, but I have never devised it!
It is from &#8220;Bit Hacks&#8221; by Sean Eron Anderson. They are not only beautiful but [...]]]></description>
			<content:encoded><![CDATA[<p>I found a short code from pyglet source code. </p>
<pre class="brush: python; ">

def _is_pow2(v):
    # http://graphics.stanford.edu/~seander/bithacks.html#DetermineIfPowerOf2
    return (v &amp; (v - 1)) == 0
</pre>
<p>At a glance, I can understand how it works, but I have never devised it!<br />
It is from <a href="http://graphics.stanford.edu/~seander/bithacks.html">&#8220;Bit Hacks&#8221;</a> by Sean Eron Anderson. They are not only beautiful but very useful in graphics libraries. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.grayger.com/bit-hacks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The culture statement of Netflix</title>
		<link>http://www.grayger.com/the-culture-statement-of-netflix/</link>
		<comments>http://www.grayger.com/the-culture-statement-of-netflix/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 15:56:23 +0000</pubDate>
		<dc:creator>grayger</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.grayger.com/wp/?p=140</guid>
		<description><![CDATA[As a company gets bigger, heavier process and controls are followed by the growth. Is the phenomenon reasonable? The culture statement of Netflix may break the stereotype.
Culture
View more presentations from Reed Hastings.

]]></description>
			<content:encoded><![CDATA[<p>As a company gets bigger, heavier process and controls are followed by the growth. Is the phenomenon reasonable? The culture statement of Netflix may break the stereotype.</p>
<div style="width:425px;text-align:left" id="__ss_1798664"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/reed2001/culture-1798664" title="Culture">Culture</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=culture9-090801103430-phpapp02&#038;rel=0&#038;stripped_title=culture-1798664" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=culture9-090801103430-phpapp02&#038;rel=0&#038;stripped_title=culture-1798664" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">presentations</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/reed2001">Reed Hastings</a>.</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.grayger.com/the-culture-statement-of-netflix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rethinking Goals Of Software Projects</title>
		<link>http://www.grayger.com/115/</link>
		<comments>http://www.grayger.com/115/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 16:05:10 +0000</pubDate>
		<dc:creator>grayger</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://www.grayger.com/wp/?p=115</guid>
		<description><![CDATA[Tom DeMarco, from his recent article in IEEE Software, says we should rethink the goal of a software project. 
 For the past 40 years, for example, we’ve tortured ourselves over our inability to finish a software project on time and on budget. But as I hinted earlier, this never should have been the supreme [...]]]></description>
			<content:encoded><![CDATA[<p>Tom DeMarco, from his recent <a href="http://www2.computer.org/cms/Computer.org/ComputingNow/homepage/2009/0709/rW_SO_Viewpoints.pdf">article in IEEE Software</a>, says we should rethink the goal of a software project. </p>
<blockquote><p> For the past 40 years, for example, we’ve tortured ourselves over our inability to finish a software project on time and on budget. But as I hinted earlier, this never should have been the supreme goal. The more important goal is transformation, creating software that changes the world or that transforms a company or how it does business.</p></blockquote>
<p>Is software engineering, which weights controls over software projects, outdated? Really? The article is too short to strenghten his sensational arguments. However, software developement may become boring and dry as we focus more on a defined process or metrics.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.grayger.com/115/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hidden Features of Java</title>
		<link>http://www.grayger.com/hidden-features-of-java/</link>
		<comments>http://www.grayger.com/hidden-features-of-java/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 15:58:31 +0000</pubDate>
		<dc:creator>grayger</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.grayger.com/wp/?p=51</guid>
		<description><![CDATA[A few days ago, I registered stackoverflow.com and found an interesting post: what are hidden features of Java?
The stuffs that I didn&#8217;t know before are

Double brace initialization


	Map map=new HashMap&#60;String,String&#62;() {
		{
			put(&#34;key1&#34;,&#34;value1&#34;);
			put(&#34;key2&#34;,&#34;value2&#34;);
		}
	};

Instance initializer


public class Initializer {
	static {
		System.out.println(&#34;static&#34;);
	}
	{
		System.out.println(&#34;instance&#34;);
	}
	public Initializer() {
		System.out.println(&#34;constructor&#34;);
	}
}

Covariant return type


	abstract class Base {
		abstract List getList();
	}

	class Sub extends Base {
		@Override
		ArrayList getList() {
			return null;
		}
	}


Double brace initialization uses instance [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago, I registered stackoverflow.com and found an interesting post: <a href="http://stackoverflow.com/questions/15496/hidden-features-of-java">what are hidden features of Java?</a></p>
<p>The stuffs that I didn&#8217;t know before are</p>
<ul>
<li>Double brace initialization</li>
<pre class="brush: java; ">

	Map map=new HashMap&lt;String,String&gt;() {
		{
			put(&quot;key1&quot;,&quot;value1&quot;);
			put(&quot;key2&quot;,&quot;value2&quot;);
		}
	};
</pre>
<li>Instance initializer</li>
<pre class="brush: java; ">

public class Initializer {
	static {
		System.out.println(&quot;static&quot;);
	}
	{
		System.out.println(&quot;instance&quot;);
	}
	public Initializer() {
		System.out.println(&quot;constructor&quot;);
	}
}
</pre>
<li>Covariant return type</li>
<pre class="brush: java; ">

	abstract class Base {
		abstract List getList();
	}

	class Sub extends Base {
		@Override
		ArrayList getList() {
			return null;
		}
	}
</pre>
</ul>
<p>Double brace initialization uses instance initializer because first brace is for declairing annomymous inner class and second brace is for instance initializer block.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.grayger.com/hidden-features-of-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript The Good Parts</title>
		<link>http://www.grayger.com/javascript-the-good-parts/</link>
		<comments>http://www.grayger.com/javascript-the-good-parts/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 16:17:09 +0000</pubDate>
		<dc:creator>grayger</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Douglas Crockford]]></category>

		<guid isPermaLink="false">http://www.grayger.com/wp/?p=37</guid>
		<description><![CDATA[&#8220;JavaScript The Good Parts&#8221; by Douglas Crockford is one of the most subjective books on JavaScript because it dares to divide JavaScript language specifications into good parts and bad parts.
Most of good parts are well-known, but not widely used. I can see they are fully and correctly used in JavaScript frameworks or toolkits but they [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;JavaScript The Good Parts&#8221; by Douglas Crockford is one of the most subjective books on JavaScript because it dares to divide JavaScript language specifications into good parts and bad parts.</p>
<p>Most of good parts are well-known, but not widely used. I can see they are fully and correctly used in JavaScript frameworks or toolkits but they are rarely or inappropriately used by page designers.</p>
<p>For me, sections on bad parts are much useful. I tell &#8220;===&#8221; from &#8220;==&#8221; but I have never used &#8220;===&#8221; just because I, as a Java programmer, am not familiar to it. The book helps use bad parts less rather than use good parts more.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.grayger.com/javascript-the-good-parts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java VM Optimization</title>
		<link>http://www.grayger.com/32/</link>
		<comments>http://www.grayger.com/32/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 14:36:54 +0000</pubDate>
		<dc:creator>grayger</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.grayger.com/wp/?p=32</guid>
		<description><![CDATA[I saw a presentation on Java VM optimization via InfoQ. Java is originally slow, but HotSpot compiler is getting smarter enough to free Java from the shame.
http://www.infoq.com/presentations/pampuch-vm-optimizations-language-designers
]]></description>
			<content:encoded><![CDATA[<p>I saw a presentation on Java VM optimization via InfoQ. Java is originally slow, but HotSpot compiler is getting smarter enough to free Java from the shame.</p>
<p><a href="http://www.infoq.com/presentations/pampuch-vm-optimizations-language-designers">http://www.infoq.com/presentations/pampuch-vm-optimizations-language-designers</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.grayger.com/32/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java deadlock detection</title>
		<link>http://www.grayger.com/java-deadlock-detection/</link>
		<comments>http://www.grayger.com/java-deadlock-detection/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 16:27:44 +0000</pubDate>
		<dc:creator>grayger</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Deadlock]]></category>
		<category><![CDATA[Profiler]]></category>

		<guid isPermaLink="false">http://www.grayger.com/wp/?p=23</guid>
		<description><![CDATA[Detecting deadlock is one of common features of Java profiling tools but I haven&#8217;t experienced the situation where those tools detect deadlock from code I wrote. In fact, deadlock is hazardous because it is difficult to predict and reproduce.
I wondered under what conditions do profilers detect deadlock and then report it, so I wrote code [...]]]></description>
			<content:encoded><![CDATA[<p>Detecting deadlock is one of common features of Java profiling tools but I haven&#8217;t experienced the situation where those tools detect deadlock from code I wrote. In fact, deadlock is hazardous because it is difficult to predict and reproduce.</p>
<p>I wondered under what conditions do profilers detect deadlock and then report it, so I wrote code that reaches deadlock.</p>
<pre class="brush: java; ">

package com.grayger.deadlock;

public class SimpleDeadlocker {
	private final static Object OBJ1=new Object();
	private final static Object OBJ2=new Object();

	private final static int LOOP=100;

	public void obj1First() {
		synchronized(OBJ1) {
			printInfo(&quot;Hold OBJ1&quot;);
			synchronized(OBJ2) {
				printInfo(&quot;Hole OBJ2&quot;);
			}
			printInfo(&quot;Release OBJ2&quot;);
		}
		printInfo(&quot;Release OBJ1&quot;);
	}

	public void obj2First() {
		synchronized(OBJ2) {
			printInfo(&quot;Hold OBJ2&quot;);
			synchronized(OBJ1) {
				printInfo(&quot;Hole OBJ1&quot;);
			}
			printInfo(&quot;Release OBJ1&quot;);
		}
		printInfo(&quot;Release OBJ2&quot;);
	}

	private void printInfo(String info) {
		System.out.println(Thread.currentThread().getName()+&quot; &quot;+info);
	}

	public static void main(String args[]) {
		final SimpleDeadlocker d=new SimpleDeadlocker();
		Thread t1=new Thread(new Runnable() {
			public void run() {
				for(int i=0;i&lt;loop;i++)&gt;
					d.obj1First();
				}
				d.printInfo(&quot;Terminated&quot;);
			}
		}, &quot;OBJ1_First&quot;);

		Thread t2=new Thread(new Runnable() {
			public void run() {
				for(int i=0;i&lt;loop;i++)&gt;
					d.obj2First();
				}
				d.printInfo(&quot;Terminated&quot;);
			}
		}, &quot;OBJ2_First&quot;);

		t1.start();
		t2.start();
	}
}
</pre>
<p>Above example can be refactored as follows:</p>
<pre class="brush: java; ">

package com.grayger.deadlock;

public class Deadlocker {
	private final static int LOOP=100;

	static class Deadlock1 {
		private final static Object OBJ1=new Object();
		private final static Object OBJ2=new Object();		

		public void obj1First() {
			synchronized(OBJ1) {
				printInfo(&quot;Hold OBJ1&quot;);
				synchronized(OBJ2) {
					printInfo(&quot;Hole OBJ2&quot;);
				}
				printInfo(&quot;Release OBJ2&quot;);
			}
			printInfo(&quot;Release OBJ1&quot;);
		}
	}

	static class Deadlock2 {
		private final static Object OBJ1=new Object();
		private final static Object OBJ2=new Object();

		public void obj2First() {
			synchronized(OBJ2) {
				printInfo(&quot;Hold OBJ2&quot;);
				synchronized(OBJ1) {
					printInfo(&quot;Hole OBJ1&quot;);
				}
				printInfo(&quot;Release OBJ1&quot;);
			}
			printInfo(&quot;Release OBJ2&quot;);
		}
	}

	public static void printInfo(String info) {
		System.out.println(Thread.currentThread().getName()+&quot; &quot;+info);
	}

	public static void main(String args[]) {
		final Deadlock1 d1=new Deadlock1();
		final Deadlock2 d2=new Deadlock2();
		Thread t1=new Thread(new Runnable() {
			public void run() {
				for(int i=0;i&lt;loop;i++)&gt;
					d1.obj1First();
				}
				Deadlocker.printInfo(&quot;Terminated&quot;);
			}
		}, &quot;OBJ1_First&quot;);

		Thread t2=new Thread(new Runnable() {
			public void run() {
				for(int i=0;i&lt;loop;i++)&gt;
					d2.obj2First();
				}
				Deadlocker.printInfo(&quot;Terminated&quot;);
			}
		}, &quot;OBJ2_First&quot;);

		t1.start();
		t2.start();
	}
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.grayger.com/java-deadlock-detection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>@Override annotation in Java6</title>
		<link>http://www.grayger.com/override-annotation-in-java6/</link>
		<comments>http://www.grayger.com/override-annotation-in-java6/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 16:10:32 +0000</pubDate>
		<dc:creator>grayger</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Annotation]]></category>

		<guid isPermaLink="false">http://www.grayger.com/wp/?p=31</guid>
		<description><![CDATA[The @Override annotation added in Java5 is very useful. Recently I found out the annotation of Java6 differs from that of Java5. Java6 allows annotating a method that implements a method declared in interface with @Override whereas Java5 doesn&#8217;t allow it.
Unfortunately I couldn&#8217;t find any document on the change from java.sun.com site. Missing this issue [...]]]></description>
			<content:encoded><![CDATA[<p>The @Override annotation added in Java5 is very useful. Recently I found out the annotation of Java6 differs from that of Java5. Java6 allows annotating a method that implements a method declared in interface with @Override whereas Java5 doesn&#8217;t allow it.</p>
<p>Unfortunately I couldn&#8217;t find any document on the change from java.sun.com site. Missing this issue from the release note of Java6 seems to be a mistake as <a title="http://blogs.sun.com/ahe/entry/override_snafu" href="http://blogs.sun.com/ahe/entry/override_snafu">http://blogs.sun.com/ahe/entry/override_snafu</a> says.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.grayger.com/override-annotation-in-java6/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
