<?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>drwxr- -r- - &#187; java</title>
	<atom:link href="http://edwardaux.wordpress.com/category/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://edwardaux.wordpress.com</link>
	<description>/dev/random</description>
	<lastBuildDate>Wed, 17 Jan 2007 23:09:20 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='edwardaux.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/0efbe74b7a4ca52db819aeb3f17d4bd8?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>drwxr- -r- - &#187; java</title>
		<link>http://edwardaux.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://edwardaux.wordpress.com/osd.xml" title="drwxr- -r- -" />
		<item>
		<title>Trap in WSAD j9vm21.dll in debug mode</title>
		<link>http://edwardaux.wordpress.com/2007/01/18/trap-in-wsad-j9vm21dll-in-debug-mode/</link>
		<comments>http://edwardaux.wordpress.com/2007/01/18/trap-in-wsad-j9vm21dll-in-debug-mode/#comments</comments>
		<pubDate>Wed, 17 Jan 2007 23:03:03 +0000</pubDate>
		<dc:creator>edwardaux</dc:creator>
				<category><![CDATA[eclipse]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://edwardaux.wordpress.com/2007/01/18/trap-in-wsad-j9vm21dll-in-debug-mode/</guid>
		<description><![CDATA[For a long time now, a few of my co-developers have been trying to figure out what caused this trap in WSAD:

Type=GPF vmState=0xffffffff
Target=20030915 (Windows XP 5.1 build 2600 Service Pack 2 x86)
ExceptionCode=0xc0000005 ExceptionAddress=0x1000ac84 ContextFlags=0x0001003f
Handler1=0x111016c0 Handler2=0x10019730
Module=c:\WSAD512\runtimes\base_v51\java\jre\bin\j9vm21.dll
Module_base_address=0x10000000
Offset_in_DLL=0x0000ac84
EDI=0x0011d9c8 ESI=0x008e5e60 EAX=0x74753f3e
EBX=0x0011d9c8 ECX=0x03b5cf14 EDX=0x7463656a
EBP=0x000be300 ESP=0x04381644 EIP=0x1000ac84
Generating crash dump: C:\Documents and Settings\c09974\j9.dmp

I had a quick look a while back, and couldn&#8217;t [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edwardaux.wordpress.com&blog=398350&post=15&subd=edwardaux&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>For a long time now, a few of my co-developers have been trying to figure out what caused this trap in WSAD:<br />
<code><br />
Type=GPF vmState=0xffffffff<br />
Target=20030915 (Windows XP 5.1 build 2600 Service Pack 2 x86)<br />
ExceptionCode=0xc0000005 ExceptionAddress=0x1000ac84 ContextFlags=0x0001003f<br />
Handler1=0x111016c0 Handler2=0x10019730<br />
Module=c:\WSAD512\runtimes\base_v51\java\jre\bin\j9vm21.dll<br />
Module_base_address=0x10000000<br />
Offset_in_DLL=0x0000ac84<br />
EDI=0x0011d9c8 ESI=0x008e5e60 EAX=0x74753f3e<br />
EBX=0x0011d9c8 ECX=0x03b5cf14 EDX=0x7463656a<br />
EBP=0x000be300 ESP=0x04381644 EIP=0x1000ac84<br />
Generating crash dump: C:\Documents and Settings\c09974\j9.dmp<br />
</code><br />
I had a quick look a while back, and couldn&#8217;t see anything obvious, and my WSAD was working OK, so I didn&#8217;t spend too much time on it <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />   Anyway, yesterday I found that I was in the same position, and the only thing that had changed on my machine was that I had installed Mercury Interactive QuickTestPro.</p>
<p>Not being able to have my server running in debug model with hot-swap turned on was completely unacceptable, so I spent a bit of time trying to track down what the problem was.<br />
<span id="more-15"></span><br />
Luckily, I was only temporarily installing QuickTestPro to help another colleague, however, the problem remained even after I had uninstalled it!  Yikes!</p>
<p>So, I used a copy of ListDLLs from <a href="http://www.sysinternals.com">SysInternals</a> to see what DLLs were in use at the time of the dump.  I then compared that list to the list of DLLs in use on a colleague&#8217;s machine that wasn&#8217;t dumping.  The only difference between was a file called <code>c:\windows\system32\micsupp.dll</code>.  Doing a hexdump of that DLL gives me a few clues such as the following strings:<br />
<code><br />
micsupp.dll<br />
ClassLoadHook<br />
JVM_OnLoad<br />
SOFTWARE\Mercury Interactive\Java Add-in\Modules<br />
</code></p>
<p>Lovely! It looks like Mercury is mucking around with my default Java installation.  I tried to renamed the dll to something else, but then I can&#8217;t even start WSAD!  So, what to do?  Perhaps it didn&#8217;t uninstall properly, so I had a look at the <code>c:\Program Files\Mercury Interactive\QuickTest Professional\dat</code> directory. In there, I found a bunch of uninstaller files that I tried to run by using the following command:<br />
<code><br />
\windows\miuninst6.exe miuninst.ini<br />
\windows\miuninst6.exe QTP65P13_NS702_SUPPORT.ini<br />
\windows\miuninst6.exe QTP65P16.ini<br />
\windows\miuninst6.exe QTP65P63.ini<br />
\windows\miuninst6.exe QTP65P84.ini<br />
\windows\miuninst6.exe QTPJAVA65P08.ini<br />
</code></p>
<p>However, that still didn&#8217;t solve the problem!  However, I did find a file called <code>install.log</code> in that directory that contained (amongst other stuff):</p>
<pre>
Installing Standalone VMs (JDK/JRE/Oracle1.3.X/Netscape 6)
[
  Copying micsupp.dll from C:\Program Files\Common Files\Mercury Interactive\SharedFiles\JavaAddin\bin to C:\WINNT\syste
m32\
  ...succeeded (return value is 0 )
  Adding _classload_hook environemtn variable
  Adding _JAVA_OPTIONS environemtn variable
]
</pre>
<p>Based on this, I thought that perhaps I should check my environment variables.  Looking at those, I found that Mercury Interactive had created the following environment variables:<br />
<code><br />
  _classload_hook<br />
  _JAVA_OPTIONS<br />
  CLASSPATH<br />
  IBM_JAVA_OPTIONS<br />
  LSERVRC<br />
  MIC_CLASSES<br />
</code></p>
<p>So, I just removed them all, and believe it or not, WSAD started up with no problems, and I could now resume debugging with hot-swap.  Thanks so much Mercury Interactive for such a quality product &#8211; not!!</p>
<p>Now, fortunately for me, I don&#8217;t actually need the Mercury Interactive QuickTestPro product on my machine, so I am confident that this fix won&#8217;t affect my normal operation.  However, if you need to use QuickTestPro, I am not sure what affect removing these environment variables will have on your installation.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/edwardaux.wordpress.com/15/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/edwardaux.wordpress.com/15/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/edwardaux.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/edwardaux.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/edwardaux.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/edwardaux.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/edwardaux.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/edwardaux.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/edwardaux.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/edwardaux.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/edwardaux.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/edwardaux.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edwardaux.wordpress.com&blog=398350&post=15&subd=edwardaux&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://edwardaux.wordpress.com/2007/01/18/trap-in-wsad-j9vm21dll-in-debug-mode/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/78ca0337f048eead2861b667cc627041?s=96&#38;d=identicon" medium="image">
			<media:title type="html">edwardaux</media:title>
		</media:content>
	</item>
		<item>
		<title>Tomcat 5.0 and jmx.jar in Eclipse</title>
		<link>http://edwardaux.wordpress.com/2007/01/16/tomcat-50-and-jmxjar-in-eclipse/</link>
		<comments>http://edwardaux.wordpress.com/2007/01/16/tomcat-50-and-jmxjar-in-eclipse/#comments</comments>
		<pubDate>Tue, 16 Jan 2007 02:30:48 +0000</pubDate>
		<dc:creator>edwardaux</dc:creator>
				<category><![CDATA[eclipse]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false">http://edwardaux.wordpress.com/2007/01/16/tomcat-50-and-jmxjar-in-eclipse/</guid>
		<description><![CDATA[I used to use the sysdeo Tomcat plugin in Eclipse for my development, but someone suggested that I take a look at the Eclipse Web Tools project, which is an application server feature for Eclipse.  It seems like it is the mechanism through which Eclipse is planning to support application servers in the future, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edwardaux.wordpress.com&blog=398350&post=11&subd=edwardaux&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I used to use the sysdeo Tomcat plugin in Eclipse for my development, but someone suggested that I take a look at the <a href="http://www.eclipse.org/webtools/">Eclipse Web Tools</a> project, which is an application server feature for Eclipse.  It seems like it is the mechanism through which Eclipse is planning to support application servers in the future, so I thought it would be worth a look.</p>
<p>However, once I got it installed, I ran into a problem that is mentioned a few times on various sites on the web, but with few solutions.  When I tried to run the application server, I got the following message:<br />
<code><br />
Due to new licensing guidelines mandated by the Apache Software Foundation Board of Directors, a JMX implementation can no longer be distributed with the Apache Tomcat binaries. As a result, you must download a JMX 1.2 implementation (such as the Sun Reference Implementation) and copy the JAR containing the API and implementation of the JMX specification to: ${catalina.home}/bin/jmx.jar<br />
</code></p>
<p>This article describes the workaround that I discovered to make Tomcat 5.0 work correctly inside Eclipse.<br />
<span id="more-11"></span><br />
But first, let&#8217;s step back to find out how I arrived at my current state.</p>
<p>From the <a href="http://www.eclipse.org/webtools/">Eclipse Web Tools home page</a>, they have a link on the top-right hand side that takes you to the latest download page.  For me, I used <a href="http://download.eclipse.org/webtools/downloads/drops/R1.5/R-1.5.2-200610261841/">Version 1.5.2</a> of the WTP.  </p>
<p>On that page they conveniently provide a link where you could download, in one thumping big file, <a href="http://www.eclipse.org/downloads/download.php?file=/webtools/downloads/drops/R1.5/R-1.5.2-200610261841/wtp-all-in-one-sdk-R-1.5.2-200610261841-win32.zip">a single zip</a> that contains Eclipse 3.2.1, WTP 1.5.2 and all the other pre-requisites (beware, it is about 200MB!)</p>
<p>On my Ubuntu machine, I originally installed eclipse using apt-get, which installs into <code>/usr/share/eclipse</code>.  To preserve all my existing shortcuts, I just renamed that directory to be <code>/usr/share/eclipse3.1</code>, and unzipped the new eclipse into <code>/usr/share/eclipse</code>.  I am not really sure if that is the sanctioned way (probably not), but it worked perfectly for me.</p>
<p>Before you create a new project, you will need to go into the Windows/Preferences menu item, and open the Server settings dialog. In here, add a new Server Runtime for Tomcat 5.0 and point it to your default tomcat directory (<code>/usr/share /tomcat5</code> for me).</p>
<p><img src='http://edwardaux.files.wordpress.com/2007/01/newserverruntime1.png' alt='newserverruntime1.png' /><br />
<img src='http://edwardaux.files.wordpress.com/2007/01/newserverruntime2.png' alt='newserverruntime2.png' /></p>
<p>From there it was a simple matter of creating a new Dynamic Web Project, where it asks me which &#8220;Target Runtime&#8221; I wanted to deploy into, and I chose the newly created Tomcat 5.0 runtime.</p>
<p>I then developed a simple web application, and when I attempted to start the Tomcat instance, I got the above error message.  Searching on the web didn&#8217;t give me too much love, and interestingly, I don&#8217;t get this message when I start Tomcat using <code>/etc/init.d/tomcat</code>.  </p>
<p>Anyway, the solution I found was to edit the runtime classpath of the application server (from the Run/Run&#8230; menu) to include the following entries:</p>
<p><img src='http://edwardaux.files.wordpress.com/2007/01/run.png' alt='run.png' /></p>
<p>Once I applied those changes, and restarted my application server, everything was working like a champion.  </p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/edwardaux.wordpress.com/11/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/edwardaux.wordpress.com/11/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/edwardaux.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/edwardaux.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/edwardaux.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/edwardaux.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/edwardaux.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/edwardaux.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/edwardaux.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/edwardaux.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/edwardaux.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/edwardaux.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edwardaux.wordpress.com&blog=398350&post=11&subd=edwardaux&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://edwardaux.wordpress.com/2007/01/16/tomcat-50-and-jmxjar-in-eclipse/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/78ca0337f048eead2861b667cc627041?s=96&#38;d=identicon" medium="image">
			<media:title type="html">edwardaux</media:title>
		</media:content>

		<media:content url="http://edwardaux.files.wordpress.com/2007/01/newserverruntime1.png" medium="image">
			<media:title type="html">newserverruntime1.png</media:title>
		</media:content>

		<media:content url="http://edwardaux.files.wordpress.com/2007/01/newserverruntime2.png" medium="image">
			<media:title type="html">newserverruntime2.png</media:title>
		</media:content>

		<media:content url="http://edwardaux.files.wordpress.com/2007/01/run.png" medium="image">
			<media:title type="html">run.png</media:title>
		</media:content>
	</item>
		<item>
		<title>Dynamically generating rounded corners in Java</title>
		<link>http://edwardaux.wordpress.com/2007/01/07/dynamically-generating-rounded-corners-in-java/</link>
		<comments>http://edwardaux.wordpress.com/2007/01/07/dynamically-generating-rounded-corners-in-java/#comments</comments>
		<pubDate>Sun, 07 Jan 2007 02:02:46 +0000</pubDate>
		<dc:creator>edwardaux</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[png]]></category>

		<guid isPermaLink="false">http://edwardaux.wordpress.com/2007/01/07/dynamically-generating-rounded-corners-in-java/</guid>
		<description><![CDATA[I was looking at re-skinning a sporting team website that I had recently created, and really liked the look of the new rounded corners that grace so many websites.  There are two main techniques that are used to achieve that look:

Having a number of 1&#215;1 pixel divs that shape the corners
Having some rounded corner [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edwardaux.wordpress.com&blog=398350&post=4&subd=edwardaux&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I was looking at re-skinning a <a href="http://www.hitkickpass.com">sporting team website</a> that I had recently created, and really liked the look of the new rounded corners that grace so many websites.  There are two main techniques that are used to achieve that look:</p>
<ol>
<li>Having a number of 1&#215;1 pixel divs that shape the corners</li>
<li>Having some rounded corner images</li>
</ol>
<p>I don&#8217;t really like the first technique because it seems so inefficient (not to mention that it reminds me of the 1&#215;1-pixel fillers of the 90&#8217;s), and the second wasn&#8217;t able to be used for my purposes because each team on my website can pick their own colour scheme from the full 24-bit RGB colour space (and I didn&#8217;t want to have to create 16777216 different corner combinations).  So, what to do?<br />
<span id="more-4"></span></p>
<h3>Generating Images Dynamically</h3>
<p>I got thinking about whether I could generate the images programmatically.  Looking at a very simple corner image up close, they really are quite simple and I figured that I could write a very simple image generator where the image shape was hard-coded, but where the colours could be substituted in at runtime.  Initially I thought that I would use the Java2D imaging libraries, but when I stopped to consider that each page would probably have 3 or 4 sections that are bounded by rounded corners, that would mean that I would be creating 12-16 images for each page load.  Whatever technique I used would have to be very lightweight and fast.  To top it all off, I also wanted to support transparency in the images so that my rounded corners could overlay on a background colour nicely.</p>
<p>It seemed to me that PNG was an excellent choice for a graphics format. It is a simple format, handles transparent pixels, and has pretty good support from all common browsers (with the exception that IE5 and IE6 cannot (natively) handle partially transparent images).  Given that most corner images are quite small (say, 10 by 10 pixels) I thought I would write a PNG generator that takes an array of, say, 100 values that represent the red, green, blue and transparency values for each pixel.  To create an 5&#215;5 image that looked like <img src="http://edwardaux.files.wordpress.com/2007/01/example1.png?w=15" width="15"> (zoomed to 15&#215;15 for clarity) would look like:</p>
<pre>
	// A 5x5 image with each line being
	// red, green, black, black, black respectively
	byte[] data = new byte[] {
		(byte)255, (byte)0, (byte)0, (byte)255,
		(byte)255, (byte)0, (byte)0, (byte)255,
		(byte)255, (byte)0, (byte)0, (byte)255,
		(byte)255, (byte)0, (byte)0, (byte)255,
		(byte)255, (byte)0, (byte)0, (byte)255,

		(byte)0, (byte)255, (byte)0, (byte)255,
		(byte)0, (byte)255, (byte)0, (byte)255,
		(byte)0, (byte)255, (byte)0, (byte)255,
		(byte)0, (byte)255, (byte)0, (byte)255,
		(byte)0, (byte)255, (byte)0, (byte)255,

		(byte)0, (byte)0, (byte)0, (byte)255,
		(byte)0, (byte)0, (byte)0, (byte)255,
		(byte)0, (byte)0, (byte)0, (byte)255,
		(byte)0, (byte)0, (byte)0, (byte)255,
		(byte)0, (byte)0, (byte)0, (byte)255,

		(byte)0, (byte)0, (byte)0, (byte)255,
		(byte)0, (byte)0, (byte)0, (byte)255,
		(byte)0, (byte)0, (byte)0, (byte)255,
		(byte)0, (byte)0, (byte)0, (byte)255,
		(byte)0, (byte)0, (byte)0, (byte)255,

		(byte)0, (byte)0, (byte)0, (byte)255,
		(byte)0, (byte)0, (byte)0, (byte)255,
		(byte)0, (byte)0, (byte)0, (byte)255,
		(byte)0, (byte)0, (byte)0, (byte)255,
		(byte)0, (byte)0, (byte)0, (byte)255,
	};
	int compress = 9;
	boolean alpha = true;
	PNGEncoder encoder = new PNGEncoder(5, 5, compress, alpha, data);

	// now let's write to the servlet output stream
	byte[] bytes = encoder.encode();
	resp.setContentLength(bytes.length);
	resp.setContentType("image/png");
	resp.getOutputStream().write(bytes, 0, bytes.length);
	resp.getOutputStream().flush();
</pre>
<p>So, as you can see, it is quite simple to invoke and pass data to.  However, it still isn&#8217;t particularly easy to define your images (it is a bit hard to visualise from the above code what the output image would look like).  </p>
<h3>Memories&#8230;</h3>
<p>Looking at a zoomed-in image, it reminded me of when, as a kid, I was using sprites to write animation for my Commodore 64.  It struck me that I could do a similar thing here.  What if I were to define a &#8220;sprite&#8221; and then just change the colours of each pixel at runtime?  For example:</p>
<pre>
	PNGSprite sprite = new PNGSprite(5, 5,
		"RRRRR"+
		"GGGGG"+
		"XXXXX"+
		"XXXXX"+
		"XXXXX");

	sprite.setColour('R', (byte)255, (byte)0,   (byte)0);
	sprite.setColour('G', (byte)0,   (byte)255, (byte)0);
	sprite.setColour('X', (byte)0,   (byte)0,   (byte)0);

	byte[] bytes = sprite.encode();
</pre>
<p>Much simpler, no?  All the PNGSprite.encode() method does is build an array of bytes like in the first example by iterating over the colours and substituting the correct RGB value.  </p>
<h3>Improving Performance</h3>
<p>This technique, however, can be further improved.  Users of the website typically tend to be looking at the same pages again and again, which means that the images do not change.  Using the technique above, there is little opportunity for caching based on the passed colours.  If we refactor slightly to make the sprite definition a constant and pass the colours into the encode() method, it gives us an opportunity to perform some caching.  So, the new code would look like:</p>
<pre>
	private static final PNGSprite sprite = new PNGSprite(5, 5,
		"RRRRR"+
		"GGGGG"+
		"XXXXX"+
		"XXXXX"+
		"XXXXX");

	...

	byte[] bytes = sprite.encode(new PNGSprite.Pixel[] {
		new PNGSprite.Pixel('R', (byte)255, (byte)0,   (byte)0),
		new PNGSprite.Pixel('G', (byte)0,   (byte)255, (byte)0),
		new PNGSprite.Pixel('X', (byte)0,   (byte)0,   (byte)0),
	});
</pre>
<h3>A Simple Cache</h3>
<p>Not a huge change, but it now gives us an opportunity to perform some simple caching.  Now, there are many, many caching algorithms but for the sake of the exercise let&#8217;s just create a simple one that caches them forever.  Feel free to implement your own algorithm that better suits your performance/memory requirements.</p>
<pre>
	public class PNGSpriteCached extends PNGSprite
	{
		private HashMap _cache = new HashMap();
		public PNGSpriteCached(int width, int height, String pattern)
		{
			super(width, height, pattern);
		}

		/**
		 * Overloads the superclass' implementation to check for a
		 * cached local copy. If not found, then we ask the superclass
		 * to encode it and we store it for later use
		 */
		public byte[] encode(Pixel[] pixels) throws IOException
		{
			Iterator iterator = _cache.keySet().iterator();
			while (iterator.hasNext())
			{
				Pixel[] cachedPixels = (Pixel[])iterator.next();
				if (Arrays.equals(cachedPixels, pixels))
					return (byte[])_cache.get(cachedPixels);
			}
			byte[] bytes = super.encode(pixels);
			_cache.put(pixels, bytes);

			return bytes;
		}
	}
</pre>
<p>To take advantage of the caching, the only change we have to make is as follows:</p>
<pre>
	private static final PNGSprite sprite = new <b>PNGSpriteCached</b>(5, 5,
		"RRRRR"+
		"GGGGG"+
		"XXXXX"+
		"XXXXX"+
		"XXXXX");
</pre>
<h3>Returning to Rounded Corners</h3>
<p>So, getting back to our original requirement for generating rounded corners dynamically&#8230; let&#8217;s create a servlet that can create each of the four corners in whatever colour we want.  For the following example, I am using 9&#215;9 corners with a solid colour and a transparent outer section.</p>
<pre>
public class ImageServlet extends HttpServlet
{
	private static final PNGSprite tl = new PNGSpriteCached(9, 9,
			".......XX"+
			".....XXXX"+
			"....XXXXX"+
			"...XXXXXX"+
			"..XXXXXXX"+
			".XXXXXXXX"+
			".XXXXXXXX"+
			"XXXXXXXXX"+
			"XXXXXXXXX");
	private static final PNGSprite tr = new PNGSpriteCached(9, 9,
			"XX......."+
			"XXXX....."+
			"XXXXX...."+
			"XXXXXX..."+
			"XXXXXXX.."+
			"XXXXXXXX."+
			"XXXXXXXX."+
			"XXXXXXXXX"+
			"XXXXXXXXX");
	private static final PNGSprite bl = new PNGSpriteCached(9, 9,
			"XXXXXXXXX"+
			"XXXXXXXXX"+
			".XXXXXXXX"+
			".XXXXXXXX"+
			"..XXXXXXX"+
			"...XXXXXX"+
			"....XXXXX"+
			".....XXXX"+
			".......XX");
	private static final PNGSprite br = new PNGSpriteCached(9, 9,
			"XXXXXXXXX"+
			"XXXXXXXXX"+
			"XXXXXXXX."+
			"XXXXXXXX."+
			"XXXXXXX.."+
			"XXXXXX..."+
			"XXXXX...."+
			"XXXX....."+
			"XX.......");

	public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException
	{
		String id = req.getParameter("id");
		PNGSprite sprite = null;
		if ("tl".equals(id))
			sprite = tl;
		else if ("tr".equals(id))
			sprite = tr;
		else if ("bl".equals(id))
			sprite = bl;
		else if ("br".equals(id))
			sprite = br;

		if (sprite != null)
		{
			String col = req.getParameter("col");
			byte[] bytes = sprite.encode(new PNGSprite.Pixel[] {
			    new PNGSprite.Pixel('X', col),
			    new PNGSprite.Pixel('.', (byte)0, (byte)0, (byte)0, (byte)0)
			});

			resp.setContentLength(bytes.length);
			resp.setContentType("image/png");
			resp.getOutputStream().write(bytes, 0, bytes.length);
			resp.getOutputStream().flush();
		}
		else
		{
			resp.sendError(404);
		}
	}
}
</pre>
<p>Then, to actually invoke them, we would use the following HTML markup:</p>
<pre>
&lt;img src="http://www.myserver.com/image?id=tl&amp;col=00ff00ff"/&gt;
&lt;img src="http://www.myserver.com/image?id=tl&amp;col=00ff00ff"/&gt;
&lt;img src="http://www.myserver.com/image?id=tl&amp;col=00ff00ff"/&gt;
&lt;img src="http://www.myserver.com/image?id=tl&amp;col=00ff00ff"/&gt;
</pre>
<p>Thus creating the following images:</p>
<p><img src="http://edwardaux.files.wordpress.com/2007/01/tl.png"><img src="http://edwardaux.files.wordpress.com/2007/01/tr.png"><br />
<br /><img src="http://edwardaux.files.wordpress.com/2007/01/bl.png"><img src="http://edwardaux.files.wordpress.com/2007/01/br.png"></p>
<p>To download the source code for PNGEncoder.java, PNGSprite.java, and PNGSpriteCached.java, click <a href="http://www.haenterprises.com.au/~craig/pngsprite.zip">here</a>.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/edwardaux.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/edwardaux.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/edwardaux.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/edwardaux.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/edwardaux.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/edwardaux.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/edwardaux.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/edwardaux.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/edwardaux.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/edwardaux.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/edwardaux.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/edwardaux.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edwardaux.wordpress.com&blog=398350&post=4&subd=edwardaux&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://edwardaux.wordpress.com/2007/01/07/dynamically-generating-rounded-corners-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/78ca0337f048eead2861b667cc627041?s=96&#38;d=identicon" medium="image">
			<media:title type="html">edwardaux</media:title>
		</media:content>

		<media:content url="http://edwardaux.files.wordpress.com/2007/01/example1.png" medium="image" />

		<media:content url="http://edwardaux.files.wordpress.com/2007/01/tl.png" medium="image" />

		<media:content url="http://edwardaux.files.wordpress.com/2007/01/tr.png" medium="image" />

		<media:content url="http://edwardaux.files.wordpress.com/2007/01/bl.png" medium="image" />

		<media:content url="http://edwardaux.files.wordpress.com/2007/01/br.png" medium="image" />
	</item>
		<item>
		<title>Configuring Tomcat5 and Apache2 to run with multiple instances</title>
		<link>http://edwardaux.wordpress.com/2006/09/20/3/</link>
		<comments>http://edwardaux.wordpress.com/2006/09/20/3/#comments</comments>
		<pubDate>Wed, 20 Sep 2006 23:39:19 +0000</pubDate>
		<dc:creator>edwardaux</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false">http://edwardaux.wordpress.com/2006/09/20/3/</guid>
		<description><![CDATA[This describes the process for configuring Tomcat 5 on Ubuntu (or Debian) so that you can have multiple instances of Tomcat running.  Typically, this would be useful when you have several domains (and/or applications)  hosted on the one server and want to keep them running independantly of one another.
The general steps are based [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edwardaux.wordpress.com&blog=398350&post=3&subd=edwardaux&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This describes the process for configuring Tomcat 5 on Ubuntu (or Debian) so that you can have multiple instances of Tomcat running.  Typically, this would be useful when you have several domains (and/or applications)  hosted on the one server and want to keep them running independantly of one another.</p>
<p>The general steps are based loosely on <a href="http://www.linuxjournal.com/article/8561">an article in LinuxJournal</a>, however, I have added afew more explanations, corrected a couple of little inaccuracies and added new content to describe the Apache2 mechanism for loading modules and sites.</p>
<p><span id="more-3"></span></p>
<h2>Pre-installed software</h2>
<p>This guide assumes that you have already installed the following applications via apt-get:</p>
<ul>
<li>j2sdk1.4</li>
<li>tomcat5</li>
<li>apache2</li>
<li>apache2-threaded-dev</li>
<li>build-essentials</li>
<li>a2enmod</li>
</ul>
<h2>Tomcat configuration</h2>
<p>Two important environment variables for Tomcat are <tt>CATALINA_HOME</tt> and <tt>CATALINA_BASE</tt>.  The first one is where the Tomcat files are  actually installed (on Ubuntu Dapper Drake, using apt-get, this is <tt>/usr/share/tomcat5</tt>).  The second one is where each running instance of Tomcat looks to find the configuration files and web applications. In the default installation, these variables are set to the same value. What we are going to do is create a directory for each of our webapps, and then start multiple instances of Tomcat with a different <tt>CATALINA_BASE</tt> for each one.</p>
<p>My suggested location (although I am open to feedback) is to create a new directory called <tt>/usr/share/tomcat5/instances</tt> that contains your applications.  Looking at that containing directory, though, you see something like:<br />
<tt></p>
<pre>
4 drwxr-xr-x   2 root root 4096 2006-08-15 08:02 bin
4 drwxr-xr-x   5 root root 4096 2006-03-19 16:27 common
0 lrwxrwxrwx   1 root root   21 2006-03-23 22:17 conf -&gt; /var/lib/tomcat5/conf
4 drwxr-xr-x   2 root root 4096 2006-03-23 22:17 .debian
0 lrwxrwxrwx   1 root root   14 2006-03-23 22:17 doc -&gt; ../doc/tomcat5
0 lrwxrwxrwx   1 root root   21 2006-03-23 22:17 logs -&gt; /var/lib/tomcat5/logs
4 drwxr-xr-x   5 root root 4096 2006-03-23 22:17 server
0 lrwxrwxrwx   1 root root   23 2006-03-23 22:17 shared -&gt; /var/lib/tomcat5/shared
0 lrwxrwxrwx   1 root root   21 2006-03-23 22:17 temp -&gt; /var/lib/tomcat5/temp
0 lrwxrwxrwx   1 root root   24 2006-03-23 22:17 webapps -&gt; /var/lib/tomcat5/webapps
0 lrwxrwxrwx   1 root root   21 2006-03-23 22:17 work -&gt; /var/lib/tomcat5/work
</pre>
<p></tt><br />
You will notice that all the actual files are stored in <tt>/var/lib/tomcat5</tt> with symbolic links across to them.  To keep with this  tradition, I used the following commands (all as root):<br />
<tt></p>
<pre>
mkdir /var/lib/tomcat5/instances
ln -s /var/lib/tomcat5/instances /usr/share/tomcat5/instances
cd /usr/share/tomcat5/instances
</pre>
<p></tt><br />
So, now the base directories have been created, you need to do the initial setup for the Tomcat servers.  Run the following commands for your webapp (where <tt>myapp</tt> is the name of your webapp):<br />
<tt></p>
<pre>
mkdir -p myapp/conf myapp/logs myapp/webapps
cp ../conf/server.xml myapp/conf
cp ../conf/web.xml myapp/conf
</pre>
<p></tt><br />
Copy your application WAR file into the <tt>myapp/webapps</tt> directory, and we should be ready to go.</p>
<h2>Starting your new instance</h2>
<p>We can&#8217;t use the original <tt>/usr/share/tomcat5/bin/startup.sh</tt> to start each instance because it uses the default <tt>CATALINA_BASE</tt>, so what we  do is create a new script file that can start and stop each instance, but pointing to a different <tt>CATALINA_BASE</tt>. Create a file called <tt>/usr/share/tomcat5/instances/myapp/myapp.sh</tt> that contains the following:<br />
<tt></p>
<pre>
#!/bin/sh

RETVAL=$?
export JAVA_HOME=/usr/lib/j2se/1.4
export CATALINA_BASE="/usr/share/tomcat5/instances/myapp"
export CATALINA_HOME="/usr/share/tomcat5"
export CATALINA_PID=$CATALINA_BASE/logs/catalina.pid

case "$1" in
 start)
        if [ -f $CATALINA_HOME/bin/startup.sh ];
          then
            echo $"Starting Tomcat"
            exec $CATALINA_HOME/bin/startup.sh
        fi
        ;;
 stop)
        if [ -f $CATALINA_HOME/bin/shutdown.sh ];
          then
            echo $"Stopping Tomcat"
            exec $CATALINA_HOME/bin/shutdown.sh
        fi
        ;;
 *)
        echo $"Usage: $0 {start|stop}"
        exit 1
        ;;
esac
exit $RETVAL
</pre>
<p></tt><br />
Make sure the original Tomcat instance is stopped (by running <tt>sudo /etc/init.d/tomcat5 stop</tt>) and start your new instance by typing:<br />
<tt></p>
<pre>
sudo chmod 755 ./myapp.sh
sudo ./myapp.sh start
</pre>
<p></tt><br />
Now test that Tomcat started up by pointing your browser to port 8180 of your machine with a valid myapp URL.</p>
<p>At this point, all we have really done is to make Tomcat start your application from a different directory.  Useful, but not yet where we want to be. We realy want to be able to point the browser to port 80, instead of the non-typical port of 8180.  So, we need to  configure Apache to hand off to the new running instance using mod_jk.</p>
<h2>mod_jk</h2>
<p>mod_jk is the means by which Apache hands off incoming HTTP requests to the Tomcat instances.  There are two flavours: mod_jk and mod_jk2.   Despite what you would think, mod_jk is the more actively developed version and is actually much simpler to install and configure.</p>
<p>In the original version of Apache, you used to have to modify the <tt>httpd.conf</tt> file, however, with Apache2 things have changed a little.  You can still edit <tt>/etc/apache2/httpd.conf</tt> if you like, but that isn&#8217;t the recommended way to configure Apache2.  Instead, you will be creating configuration files in the following two directories:</p>
<ul>
<li><tt>/etc/apache2/mods-available</tt></li>
<li><tt>/etc/apache2/sites-available</tt></li>
</ul>
<p>Before you do that, however, you need to install mod_jk.  Download the <a href="http://www.apache.org/dist/jakarta/tomcat-connectors/jk/source/jk-1.2.14/jakarta-tomcat-connectors-1.2.14.1-src.tar.gz">mod_jk source code</a>, and run the following commands:<br />
<tt></p>
<pre>
tar -xzvf jakarta-tomcat-connectors-1.2.14.1-src.tar.gz
cd jakarta-tomcat-connectors-1.2.14.1/jk/native
./configure --with-apxs=/usr/sbin/apxs2
make
sudo make install
</pre>
<p></tt><br />
The last command should install a file called <tt>mod_jk.so</tt> in <tt>/usr/lib/apache2/modules</tt>.  You might want to just quickly check that it is  there. </p>
<p>Now, you need to create a file called <tt>/etc/apache2/mods-available/jk.load</tt> that contains:<br />
<tt></p>
<pre>
LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so
</pre>
<p></tt></p>
<p>Next, create a file called <tt>/etc/apache2/mods-available/jk.conf</tt> that contains:<br />
<tt></p>
<pre>
&lt;IfModule mod_jk.c&gt;
  JkWorkersFile       "/etc/apache2/workers.properties"
  JkLogFile           "/var/log/apache2/mod_jk.log"
  JkLogLevel          info
  JkLogStampFormat    "[%a %b %d %H:%M:%S %Y] "
  JkOptions           +ForwardKeySize +ForwardURICompat -ForwardDirectories
  JkRequestLogFormat  "%w %V %T"
&lt;/IfModule&gt;
</pre>
<p></tt></p>
<p>Now, from the command prompt, type the following commands to enable it and become effective.  The <tt>a2enmod</tt> command enables a specific module by creating a symbolic link in <tt>/etc/apache2/mods-enabled</tt> that points to the equivalent file in <tt>/etc/apache2/mods-available</tt> directory.<br />
<tt></p>
<pre>
sudo a2enmod jk
sudo /etc/init.d/apache2 force-reload
</pre>
<p></tt></p>
<p>Nice work.  Now you have enabled mod_jk.  Now we have to configure a virtual host in Apache to point to our Tomcat instance.  You do this by creating a file called <tt>/etc/apache2/sites-available/yourdomain.com</tt> and adding the following content:<br />
<tt></p>
<pre>
&lt;VirtualHost yourdomain:80&gt;
        ServerAdmin admin@yourdomain.com
        ServerName  yourdomain.com
        ServerAlias www.yourdomain.com

        JkMount /* myapp
&lt;/VirtualHost&gt;
</pre>
<p></tt></p>
<p>This defines a virtual domain that has a Tomcat application called <tt>myapp</tt>. In fact, the <tt>myapp</tt> identifier is not actually the application name,  but actually references an entry in the <tt>workers.properties</tt> file (see below).  However, while not strictly necessary, if you keep this naming convention it makes it nice and easy to read the configurations when your mod_jk identifiers are the same as your webapp names. The <tt>JkMount /* myapp</tt> directive instructs Apache to send all urls to Tomcat (via mod_jk).  You  can, if you choose, a different pattern that more accurately reflects which requests you want Tomcat to handle (for example, <tt>JkMount /*.do myapp</tt>).</p>
<p>You need to make this new site available for use, so type the following command:<br />
<tt></p>
<pre>
sudo a2ensite yourdomain.com
sudo /etc/init.d/apache2 force-reload
</pre>
<p></tt></p>
<p>And lastly, we need to tell mod_jk what port Tomcat will be listening on by creating the configuration file that we referenced in  <tt>/etc/apache2/mods-available/jk.conf</tt>.  So, create a new file called <tt>/etc/apache2/workers.properties</tt> that contains:<br />
<tt></p>
<pre>
worker.list=myapp

# Set properties for myapp
worker.myapp.type=ajp13
worker.myapp.host=localhost
worker.myapp.port=8009
</pre>
<p></tt></p>
<p>The <tt>worker.list</tt> directive says which of the configurations is available for use.  For now, only <tt>myapp</tt> is available because we have only got one application.  This tutorial has Tomcat and Apache on the same machine, so we use <tt>localhost</tt> as the host.  The port that mod_jk will send connections to is 8009, which is the default Tomcat AJP13 listening port. When we add second, and subsequent, applications we will use different port numbers.</p>
<p>Stop and restart Apache by running the following command:<br />
<tt></p>
<pre>
/etc/init.d/apache2 restart
</pre>
<p></tt></p>
<p>Now, point your browser to your machine, but on port 80 this time.  If all has gone well, you should seamlessly get passed through  Apache into Tomcat via AJP.</p>
<p>The last thing to do is make Tomcat only accept incoming connections via the AJP connector, instead of allowing connections  directly to port 8180 (the HTTP connector).  This can be done by editing the <tt>myapp/conf/server.xml</tt> to comment out the HTTP connector.<br />
<tt></p>
<pre>
&lt;!-- Connector className="org.apache.coyote.tomcat5.CoyoteConnector"
               port="8180" minProcessors="5" maxProcessors="75"
               enableLookups="true" acceptCount="10" debug="0"
               connectionTimeout="20000" useURIValidationHack="false" / --&gt;
</pre>
<p></tt></p>
<h2>Adding second and subsequent webapps</h2>
<p>Adding additional webapps is reasonably straightforward. One thing to decide before proceeding is what port numbers to use for your new webapp(s).  The default server.xml will have the shutdown port being 8005 and the AJP connector port being 8009.  Now, we already know that our first webapp (myapp, in this example) is using those ports, so we need to pick new port  numbers.  You can pick any port numbers you like, but the convention seems to be 8105/8109 for the second webapp, 8205/8209  for the third, and so on. The required steps are outline below:</p>
<ol>
<li>Run the following commands:<br />
<tt></p>
<pre>
mkdir -p app2/conf app2/logs app2/webapps
cp ../conf/server.xml app2/conf
cp ../conf/web.xml app2/conf
</pre>
<p></tt>
</li>
<li>Edit the <tt>app2/conf/server.xml</tt>, changing these items:
<ul>
<li>Change the port attribute of the <tt>&lt;Server&gt;</tt> tag from 8005 to 8105.</li>
<li>Change the port attribute of the AJP <tt>&lt;Connector&gt;</tt> tag from 8009 to 8109.</li>
<li>Optionally, comment out the HTTP <tt>&lt;Connector&gt;</tt> tag.  If you don&#8217;t comment it out (and you didn&#8217;t comment it out in <tt>myapp/conf/server.xml</tt>) you will need to change the value from 8180 to 8181 (or some other port) so that the HTTP connectors of your two webapps aren&#8217;t listening on the same port.</li>
</ul>
</li>
<li>Edit the <tt>/etc/apache2/workers.properties</tt> to add new lines that look like:<br />
<tt></p>
<pre>
worker.list=myapp,app2

# Set properties for myapp
worker.myapp.type=ajp13
worker.myapp.host=localhost
worker.myapp.port=8009

# Set properties for app2
worker.app2.type=ajp13
worker.app2.host=localhost
worker.app2.port=8109
</pre>
<p></tt>
</li>
<li>Create a file called <tt>/etc/apache2/sites-available/anotherdomain.com</tt> and adding the following content:<br />
<tt></p>
<pre>
&lt;VirtualHost anotherdomain:80&gt;
        ServerAdmin admin@anotherdomain.com
        ServerName  anotherdomain.com
        ServerAlias www.anotherdomain.com

        JkMount /* app2
&lt;/VirtualHost&gt;
</pre>
<p></tt>
  </li>
<li>Enable your new site by running the following commands:<br />
<tt></p>
<pre>
sudo a2ensite anotherdomain.com
sudo /etc/init.d/apache force-reload
</pre>
<p></tt>
	</li>
<li>Copy the <tt>myapp/myapp.sh</tt> script as <tt>app2/app2.sh</tt> directory, and modify the line with <tt>CATALINA_BASE</tt> to point to the <tt>app2</tt> directory instead of the <tt>myapp</tt> directory.</li>
<li>Copy your application WAR file into the <tt>app2/webapps</tt> directory</li>
<li>Restart Apache by running <tt>/etc/init.d/apache2 restart</tt></li>
<li>Start your application by running <tt>app2.sh start</tt></li>
</ol>
<h2>Starting automatically</h2>
<p>Now, having installed your webapp successfully, you may want to get it to start automatically upon a system restart. The conventional way to do this is to run the following commands:<br />
<tt></p>
<pre>
sudo ln -s /usr/share/tomcat5/instances/myapp/myapp.sh /etc/init.d/myapp.sh
sudo update-rc.d /etc/init.d/myapp.sh defaults 70
</pre>
<p></tt><br />
Repeat these commands for whichever Tomcat servers you want automatically restarted.</p>
<h2>Feedback</h2>
<p>If you spot any typos or mistakes, please let me know and I will correct ASAP.  Thanks a lot.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/edwardaux.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/edwardaux.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/edwardaux.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/edwardaux.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/edwardaux.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/edwardaux.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/edwardaux.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/edwardaux.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/edwardaux.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/edwardaux.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/edwardaux.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/edwardaux.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edwardaux.wordpress.com&blog=398350&post=3&subd=edwardaux&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://edwardaux.wordpress.com/2006/09/20/3/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/78ca0337f048eead2861b667cc627041?s=96&#38;d=identicon" medium="image">
			<media:title type="html">edwardaux</media:title>
		</media:content>
	</item>
	</channel>
</rss>