<?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>Thu, 02 Sep 2010 03:47:51 +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>[NEW GAME] Conveyor</title>
		<link>http://www.grayger.com/uncategorized/new-game-conveyor/</link>
		<comments>http://www.grayger.com/uncategorized/new-game-conveyor/#comments</comments>
		<pubDate>Thu, 02 Sep 2010 03:45:41 +0000</pubDate>
		<dc:creator>grayger</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.grayger.com/?p=503</guid>
		<description><![CDATA[My new game &#8220;Conveyor&#8221; was released at agame.com. The game was translated into more than 12 languages.
Check out Conveyor! 

]]></description>
			<content:encoded><![CDATA[<p>My new game &#8220;Conveyor&#8221; was released at agame.com. The game was translated into more than 12 languages.<br />
<a href="http://www.agame.com/game/conveyor.html">Check out Conveyor!</a> </p>
<p><img src="http://www.grayger.com/gamerep/conveyor/_lv4.png" border="1" alt="lv4" width="175" height="125" /><img src="http://www.grayger.com/gamerep/conveyor/_lv9.png" border="1" alt="lv9" width="175" height="125" /><img src="http://www.grayger.com/gamerep/conveyor/_lv10.png" border="1" alt="lv10" width="175" height="125" /><img src="http://www.grayger.com/gamerep/conveyor/_lv18.png" border="1" alt="lv18" width="175" height="125" /><img src="http://www.grayger.com/gamerep/conveyor/_lv19.png" border="1" alt="lv19" width="175" height="125" /><img src="http://www.grayger.com/gamerep/conveyor/_lv21.png" border="1" alt="lv24" width="175" height="125" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.grayger.com/uncategorized/new-game-conveyor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[New Game] Snake Runaway</title>
		<link>http://www.grayger.com/game/new-game-snake-runaway/</link>
		<comments>http://www.grayger.com/game/new-game-snake-runaway/#comments</comments>
		<pubDate>Mon, 03 May 2010 06:23:24 +0000</pubDate>
		<dc:creator>grayger</dc:creator>
				<category><![CDATA[Game]]></category>
		<category><![CDATA[snake runaway]]></category>

		<guid isPermaLink="false">http://www.grayger.com/?p=455</guid>
		<description><![CDATA[I just uploaded a new game to kongregate! The Snake Runaway is an unique snake game I think.
You can play it via http://www.kongregate.com/games/grayger/snake-runaway
I welcome your comment.

]]></description>
			<content:encoded><![CDATA[<p>I just uploaded a new game to kongregate! The Snake Runaway is an unique snake game I think.</p>
<p>You can play it via <a href="http://www.kongregate.com/games/grayger/snake-runaway">http://www.kongregate.com/games/grayger/snake-runaway</a><br />
I welcome your comment.</p>
<p><a href="http://www.grayger.com/games/snake-runaway"><img title="snakerunaway200x150" src="http://www.grayger.com/wp-content/uploads/2010/05/snakerunaway200x150.png" alt="" width="200" height="150" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.grayger.com/game/new-game-snake-runaway/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Changes on this site</title>
		<link>http://www.grayger.com/uncategorized/changes-on-this-site/</link>
		<comments>http://www.grayger.com/uncategorized/changes-on-this-site/#comments</comments>
		<pubDate>Sat, 03 Apr 2010 03:14:18 +0000</pubDate>
		<dc:creator>grayger</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.grayger.com/?p=451</guid>
		<description><![CDATA[I changed this site a little yesterday.
1. Design
After reading documents of wordpress, I made my own theme for the arcade site. I started my work from cbone theme, and changed CSS, images, etc. and created some page templates. I found making theme is not difficult because the architecture of wordpress is very flexible, and that [...]]]></description>
			<content:encoded><![CDATA[<p>I changed this site a little yesterday.<br />
1. Design<br />
After reading documents of wordpress, I made my own theme for the arcade site. I started my work from <a href="http://www.webdesign-er.com">cbone</a> theme, and changed CSS, images, etc. and created some page templates. I found making theme is not difficult because the architecture of wordpress is very flexible, and that is one of the reason why it is widely spread. I will study theme and plugin architecture more, and change this site little by little. </p>
<p>2. Contents<br />
The new <a href="http://www.grayger.com/games">game page</a> looks similar to (crapy) game portals. While most game portals have categories such as action, sports, puzzle etc., my site has categories: fun, artistic, additing, creative, even undervalued which is for games that are not popular but more attention should be paid to. There is also a category for games developed by me. I created pages for each game by hand. The hassle job includes downloading a zipped game bundle from mochi games, extracting it, and constructing the page. I will automate the job later. </p>
<p>My job is to make games. I don&#8217;t want to put much time on this site. It is for just fun.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.grayger.com/uncategorized/changes-on-this-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[New Game] Garbage Separator</title>
		<link>http://www.grayger.com/game/new-game-garbage-separator/</link>
		<comments>http://www.grayger.com/game/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>
]]></content:encoded>
			<wfw:commentRss>http://www.grayger.com/game/new-game-garbage-separator/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fire Special Effect in Python</title>
		<link>http://www.grayger.com/python-eng/fire-effect/</link>
		<comments>http://www.grayger.com/python-eng/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/python-eng/fire-effect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bit Hacks</title>
		<link>http://www.grayger.com/python-eng/bit-hacks/</link>
		<comments>http://www.grayger.com/python-eng/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/python-eng/bit-hacks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The culture statement of Netflix</title>
		<link>http://www.grayger.com/uncategorized/the-culture-statement-of-netflix/</link>
		<comments>http://www.grayger.com/uncategorized/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/uncategorized/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/uncategorized/115/</link>
		<comments>http://www.grayger.com/uncategorized/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/uncategorized/115/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hidden Features of Java</title>
		<link>http://www.grayger.com/java-eng/hidden-features-of-java/</link>
		<comments>http://www.grayger.com/java-eng/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/java-eng/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/javascript-the-good-parts/</link>
		<comments>http://www.grayger.com/javascript/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/javascript-the-good-parts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
