<?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></title>
	<atom:link href="http://javatage.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://javatage.wordpress.com</link>
	<description>I think i am, therefore i am .. i think.</description>
	<lastBuildDate>Mon, 14 Jun 2010 15:11:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='javatage.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/2c8b3cd5b9e6fc409c76ed54a8ea583b?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title></title>
		<link>http://javatage.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://javatage.wordpress.com/osd.xml" title="" />
	<atom:link rel='hub' href='http://javatage.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Rexeg</title>
		<link>http://javatage.wordpress.com/2010/06/14/rexeg/</link>
		<comments>http://javatage.wordpress.com/2010/06/14/rexeg/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 15:11:47 +0000</pubDate>
		<dc:creator>javatage</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://javatage.wordpress.com/?p=93</guid>
		<description><![CDATA[Many languages, including Perl, PHP, Python, JavaScript, and JScript, now support regular expressions for text processing, and some text editors use regular expressions for powerful search-and-replace functionality. What about Java? At the time of this writing, a Java Specification Request &#8230; <a href="http://javatage.wordpress.com/2010/06/14/rexeg/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javatage.wordpress.com&amp;blog=14168910&amp;post=93&amp;subd=javatage&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Many languages, including Perl, PHP, Python, JavaScript, and JScript, now support regular expressions for text processing, and some text editors use regular expressions for powerful search-and-replace functionality. What about Java? At the time of this writing, a Java Specification Request that includes a regular expression library for text processing has been approved; you can expect to see it in a future version of the JDK.</p>
<p>But what if you need a regular expression library now? Luckily, you can download the open source Jakarta ORO library from                         <a href="http://www.javaworld.com/javaworld/jw-07-2001/jw-0713-regex.html#resources">Apache.org</a>. In this article, I&#8217;ll first give you a short primer on regular expressions, and then I&#8217;ll show you how to use regular expressions with the open source Jakarta-ORO API.</p>
<h3>Regular expressions 101</h3>
<p>Let&#8217;s start simple. Suppose you want to search for a string with the word &#8220;cat&#8221; in it; your regular expression would simply be &#8220;cat&#8221;. If your search is case-insensitive, the words &#8220;catalog&#8221;, &#8220;Catherine&#8221;, or &#8220;sophisticated&#8221; would also match:</p>
<blockquote><p>Regular expression: cat<br />
Matches: cat, catalog, Catherine, sophisticated</p></blockquote>
<h4>The period notation</h4>
<p>Imagine you are playing Scrabble and need a three-letter word starting with the letter &#8220;t&#8221; and ending with the letter &#8220;n&#8221;. Imagine also that you have an English dictionary and will search through its entire contents for a match using a regular expression. To form such a regular expression, you would use a <em>wildcard notation</em> &#8212; the period (.) character. The regular expression would then be &#8220;t.n&#8221; and would match &#8220;tan&#8221;, &#8220;Ten&#8221;, &#8220;tin&#8221;, and &#8220;ton&#8221;; it would also match &#8220;t#n&#8221;, &#8220;tpn&#8221;, and even &#8220;t n&#8221;, as well as many other nonsensical words. This is because the period character matches everything, including the space, the tab character, and even line breaks:</p>
<blockquote><p>Regular expression: t.n<br />
Matches: tan, Ten, tin, ton, t n, t#n, tpn, etc.</p></blockquote>
<h4>The bracket notation</h4>
<p>To solve the problem of the period&#8217;s indiscriminate matches, you can specify characters you consider meaningful with the bracket (&#8220;[]&#8220;) expression, so that only those characters would match the regular expression. Thus, &#8220;t[aeio]n&#8221; would just match &#8220;tan&#8221;, &#8220;Ten&#8221;, &#8220;tin&#8221;, and &#8220;ton&#8221;. &#8220;Toon&#8221; would not match because you can only match a single character within the bracket notation:</p>
<blockquote><p>Regular expression: t[aeio]n<br />
Matches: tan, Ten, tin, ton</p></blockquote>
<h4>The OR operator</h4>
<p>If you want to match &#8220;toon&#8221; in addition to all the words matched in the previous section, you can use the &#8220;|&#8221; notation, which is basically an OR operator. To match &#8220;toon&#8221;, use the regular expression &#8220;t(a|e|i|o|oo)n&#8221;. You cannot use the bracket notation here because it will only match a single character. Instead, use parentheses &#8212; &#8220;()&#8221;. You can also use parentheses for groupings (more on that later):</p>
<blockquote><p>Regular expression: t(a|e|i|o|oo)n<br />
Matches: tan, Ten, tin, ton, toon</p></blockquote>
<h4>The quantifier notations</h4>
<p>Table 1 shows the quantifier notations used to determine how many times a given notation to the immediate left of the quantifier                         notation should repeat itself:</p>
<table cellspacing="1" cellpadding="1" width="45%" align="center" bgcolor="#99cc00">
<caption><strong><span>Table 1. Quantifier notations</span></strong></caption>
<tbody>
<tr bgcolor="#ffff99">
<th>Notation</th>
<th>Number of Times</th>
</tr>
<tr bgcolor="#ffffcc">
<td align="left">*</td>
<td align="left">0 or more times</td>
</tr>
<tr bgcolor="#ffff99">
<td align="left">+</td>
<td align="left">1 or more times</td>
</tr>
<tr bgcolor="#ffffcc">
<td align="left">?</td>
<td align="left">0 or 1 time</td>
</tr>
<tr bgcolor="#ffff99">
<td align="left">{n}</td>
<td align="left">Exactly n number of times</td>
</tr>
<tr bgcolor="#ffffcc">
<td align="left">{n,m}</td>
<td align="left">n to m number of times</td>
</tr>
</tbody>
</table>
<p>Let&#8217;s say you want to search for a social security number in a text file. The format for US social security numbers is 999-99-9999. The regular expression you would use to match this is shown in Figure 1. In regular expressions, the hyphen (&#8220;-&#8221;) notation has special meaning; it indicates a range that would match any number from 0 to 9. As a result, you must escape the &#8220;-&#8221; character with a forward slash (&#8220;\&#8221;) when matching the literal hyphens in a social security number.</p>
<p><img src="http://www.javaworld.com/javaworld/jw-07-2001/images/jw-0713-SSN1.gif" alt="" width="458" height="111" /></p>
<p><strong>Figure 1. Matches: All social security numbers of the form 123-12-1234</strong></p>
<p>If, in your search, you wish to make the hyphen optional &#8212; if, say, you consider both 999-99-9999 and 999999999 acceptable                         formats &#8212; you can use the &#8220;?&#8221; quantifier notation. Figure 2 shows that regular expression:</p>
<p><img src="http://www.javaworld.com/javaworld/jw-07-2001/images/jw-0713-SSN2.gif" alt="" width="512" height="103" /></p>
<p><strong>Figure 2. Matches: All social security numbers of the forms 123-12-1234 and 123121234</strong></p>
<p>Let&#8217;s take a look at another example. One format for US car plate numbers consists of four numeric characters followed by two letters. The regular expression first comprises the numeric part, &#8220;[0-9]{4}&#8221;, followed by the textual part, &#8220;[A-Z]{2}&#8221;. Figure 3 shows the complete regular expression:</p>
<p><img src="http://www.javaworld.com/javaworld/jw-07-2001/images/jw-0713-Carplate.gif" alt="" width="269" height="71" /></p>
<p><strong>Figure 3. Matches: Typical US car plate numbers, such as 8836KV</strong></p>
<h4>The NOT notation</h4>
<p>The &#8220;^&#8221; notation is also called the NOT notation. If used in brackets, &#8220;^&#8221; indicates the character you don&#8217;t want to match.                      For example, the expression in Figure 4 matches all words <em>except</em> those starting with the letter X.</p>
<p><img src="http://www.javaworld.com/javaworld/jw-07-2001/images/jw-0713-NoXWord.gif" alt="" width="530" height="94" /></p>
<p><strong>Figure 4. Matches: All words except those that start with the letter X</strong></p>
<h4>The parentheses and space notations</h4>
<p>Say you&#8217;re trying to extract the birth month from a person&#8217;s birthdate. The typical birthdate is in the following format:                         June 26, 1951. The regular expression to match the string would be like the one in Figure 5:</p>
<p><img src="http://www.javaworld.com/javaworld/jw-07-2001/images/jw-0713-BirthDate1.gif" alt="" width="547" height="121" /></p>
<p><strong>Figure 5. Matches: All dates with the format of Month DD, YYYY</strong></p>
<p>The new &#8220;\s&#8221; notation is the space notation and matches all blank spaces, including tabs. If the string matches perfectly, how do you extract the month field? You simply put parentheses around the month field, creating a group, and later retrieve the value using the ORO API (discussed in a following section). The appropriate regular expression is in Figure 6:</p>
<p><img src="http://www.javaworld.com/javaworld/jw-07-2001/images/jw-0713-BirthDate2.gif" alt="" width="541" height="128" /></p>
<p><strong>Figure 6. Matches: All dates with the format Month DD, YYYY, and extracts Month field as Group 1</strong></p>
<h4>Other miscellaneous notations</h4>
<p>To make life easier, some shorthand notations for commonly used regular expressions have been created, as shown in Table 2:</p>
<table cellspacing="1" cellpadding="1" width="45%" align="center" bgcolor="#99cc00">
<caption><strong><span>Table 2. Commonly used notations</span></strong></caption>
<tbody>
<tr bgcolor="#ffff99">
<th>Notation</th>
<th>Equivalent Notation</th>
</tr>
<tr bgcolor="#ffffcc">
<td align="left">\d</td>
<td align="left">[0-9]</td>
</tr>
<tr bgcolor="#ffff99">
<td align="left">\D</td>
<td align="left">[^0-9]</td>
</tr>
<tr bgcolor="#ffffcc">
<td align="left">\w</td>
<td align="left">[A-Z0-9]</td>
</tr>
<tr bgcolor="#ffff99">
<td align="left">\W</td>
<td align="left">[^A-Z0-9]</td>
</tr>
<tr bgcolor="#ffffcc">
<td align="left">\s</td>
<td align="left">[ \t\n\r\f]</td>
</tr>
<tr bgcolor="#ffff99">
<td align="left">\S</td>
<td align="left">[^ \t\n\r\f]</td>
</tr>
</tbody>
</table>
<p>To illustrate, we can use &#8220;\d&#8221; for all instances of &#8220;[0-9]&#8221; we used before, as was the case with our social security number                         expressions. The revised regular expression is in Figure 7:</p>
<p><img src="http://www.javaworld.com/javaworld/jw-07-2001/images/jw-0713-SSN3.gif" alt="" width="379" height="102" /></p>
<p><strong>Figure 7. Matches: All social security numbers of the form 123-12-1234</strong></p>
<h3>Jakarta-ORO library</h3>
<p>Many open source regular expression libraries are available for Java programmers, and many support the Perl 5-compatible regular expression syntax. I use the Jakarta-ORO regular expression library because it is one of the most comprehensive APIs available and is fully compatible with Perl 5 regular expressions. It is also one of the most optimized APIs around.</p>
<p>The Jakarta-ORO library was formerly known as OROMatcher and has been kindly donated to the Jakarta Project by Daniel Savarese.                         You can download the package from a link in the <a href="http://www.javaworld.com/javaworld/jw-07-2001/jw-0713-regex.html?page=3#resources">Resources</a> section below.</p>
<h3>The Jakarta-ORO objects</h3>
<p>I&#8217;ll start by briefly describing the objects you need to create and access in order to use this library, and then I will show                         how you use the Jakarta-ORO API.</p>
<h4>The PatternCompiler object</h4>
<p>First, create an instance of the <code>Perl5Compiler</code> class and assign it to the <code>PatternCompiler</code> interface object. <code>Perl5Compiler</code> is an implementation of the <code>PatternCompiler</code> interface and lets you compile a regular expression string into a <code>Pattern</code> object used for matching:</p>
<div id="codewrap">
<div id="codewrap145">
<pre>      PatternCompiler compiler=new Perl5Compiler();
</pre>
</div>
</div>
<h4>The Pattern object</h4>
<p>To compile a regular expression into a <code>Pattern</code> object, call the <code>compile()</code> method of the compiler object, passing in the regular expression. For example, you can compile the regular expression <code>"t[aeio]n"</code> like so:</p>
<div id="codewrap">
<div id="codewrap154">
<pre>        Pattern pattern=null;
        try {
                pattern=compiler.compile("t[aeio]n");
        } catch (MalformedPatternException e) {
                e.printStackTrace();
        }
</pre>
</div>
</div>
<p>By default, the compiler creates a case-sensitive pattern, so that the above setup only matches &#8220;tin&#8221;, &#8220;tan&#8221;, &#8220;ten&#8221;, and &#8220;ton&#8221;, but not &#8220;Tin&#8221; or &#8220;taN&#8221;. To create a case-insensitive pattern, you would call a compiler with an additional mask:</p>
<div id="codewrap">
<div id="codewrap158">
<pre>        pattern=compiler.compile("t[aeio]n",Perl5Compiler.CASE_INSENSITIVE_MASK);
</pre>
</div>
</div>
<p>Once you&#8217;ve created the <code>Pattern</code> object, you can use it for pattern matching with the <code>PatternMatcher</code> class.</p>
<h4>The PatternMatcher object</h4>
<p>The <code>PatternMatcher</code> object tests for a match based on the <code>Pattern</code> object and a string. You instantiate a <code>Perl5Matcher</code> class and assign it to the <code>PatternMatcher</code> interface. The <code>Perl5Matcher</code> class is an implementation of the <code>PatternMatcher</code> interface and matches patterns based on the Perl 5 regular expression syntax:</p>
<div id="codewrap">
<div id="codewrap172">
<pre>        PatternMatcher matcher=new Perl5Matcher();
</pre>
</div>
</div>
<p>You can obtain a match using the <code>PatternMatcher</code> object in one of several ways, with the string to be matched against the regular expression passed in as the first parameter:</p>
<ul>
<li><code>boolean matches(String input, Pattern pattern)</code>: Used if the input string and the regular expression should match exactly; in other words, the regular expression should                            totally describe the string input</li>
<li><code>boolean matchesPrefix(String input, Pattern pattern)</code>: Used if the regular expression should match the beginning of the input string</li>
<li><code>boolean contains(String input, Pattern pattern)</code>: Used if the regular expression should match part of the input string (i.e., should be a substring)</li>
</ul>
<p>You could also pass in a <code>PatternMatcherInput</code> object instead of a <code>String</code> object to the above three method calls; if you did so, you could continue matching from the point at which the last match was found in the string. This is useful when you have many substrings that are likely to be matched by a given regular expression. The method signatures with the <code>PatternMatcherInput</code> object instead of <code>String</code> are as follows:</p>
<ul>
<li><code>boolean matches(PatternMatcherInput input, Pattern pattern)</code></li>
<li><code>boolean matchesPrefix(PatternMatcherInput input, Pattern pattern)</code></li>
<li><code>boolean contains(PatternMatcherInput input, Pattern pattern)</code></li>
</ul>
<h3>Scenarios for using the API</h3>
<p>Now let&#8217;s discuss some example uses of the Jakarta-ORO library.</p>
<h4>Log file processing</h4>
<p>Your job: analyze a Web server log file and determine how long each user spends on the Website. An entry from a typical BEA                         WebLogic log file looks like this:</p>
<div id="codewrap">
<div id="codewrap205">
<pre>172.26.155.241 - - [26/Feb/2001:10:56:03 -0500] "GET /IsAlive.htm HTTP/1.0" 200 15
</pre>
</div>
</div>
<p>After analyzing this entry, you&#8217;ll realize that you need to extract two things from the log file: the IP address and a page&#8217;s access time. You can use the grouping notation (parentheses) to extract the IP address field and the timestamp field from the log entry.</p>
<p>Let&#8217;s first discuss the IP address. It consists of 4 bytes, each with values between 0 and 255; each byte is separated from the others by a period. Thus, in each individual byte in the IP address, you have at least one and at most three digits. You can see the regular expression for this field in Figure 8:</p>
<p><img src="http://www.javaworld.com/javaworld/jw-07-2001/images/jw-0713-IP1.gif" alt="" width="559" height="132" /></p>
<p><strong>Figure 8. Matches: IP addresses that consist of 4 bytes, each with values between 0 and 255</strong></p>
<p>You need to escape the period character because you literally want it to be there; you do not want it read in terms of its                         special meaning in regular expression syntax, which I explained earlier.</p>
<p>The log entry&#8217;s timestamp part is surrounded by square brackets. You can extract whatever is within these brackets by first searching for the opening square bracket character (&#8220;[") and extracting whatever is not within the closing square bracket character ("]&#8220;), continuing until you reach the closing square bracket. Figure 9 shows the regular expression for this:</p>
<p><img src="http://www.javaworld.com/javaworld/jw-07-2001/images/jw-0713-IP2.gif" alt="" width="358" height="208" /></p>
<p><strong>Figure 9. Matches: At least one character until &#8220;]&#8221; is found</strong></p>
<p>Now you combine these two regular expressions into a single expression with grouping notation (parentheses) for extraction of your IP address and timestamp. Notice that &#8220;\s-\s-\s&#8221; is added in the middle so that matching occurs, although you won&#8217;t extract that. You can see the complete regular expression in <a href="http://www.javaworld.com/javaworld/jw-07-2001/images/jw-0713-IP3.gif" target="_blank">Figure 10</a>.</p>
<table border="0" cellspacing="4" cellpadding="4" width="200" align="right">
<tbody>
<tr>
<td align="center"><a href="http://www.javaworld.com/javaworld/jw-07-2001/images/jw-0713-IP3.gif" target="_blank"><img src="http://www.javaworld.com/javaworld/jw-07-2001/images/jw-0713-IP3_sml.gif" alt="" /></a><br />
<strong><span>Figure 10. Matches: The IP address and timestamp by combining two regular expressions. Click on thumbnail to view full-size                                     image. (4 KB)</span></strong></td>
</tr>
</tbody>
</table>
<p>Now that you&#8217;ve formulated this regular expression, you can begin writing Java code using the regular expression library.</p>
<h4>Using the Jakarta-ORO library</h4>
<p>To begin using the Jakarta-ORO library, first create the regular expression string and the sample string to parse:</p>
<div id="codewrap">
<div id="codewrap238">
<pre>      String logEntry="172.26.155.241 - - [26/Feb/2001:10:56:03 -0500] \"GET /IsAlive.htm HTTP/1.0\" 200 15 ";
        String regexp="([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})\\s-\\s-\\s\\[([^\\]]+)\\]";
</pre>
</div>
</div>
<p>The regular expression used here is nearly identical to the one found in Figure 10, with only one difference: in Java, you need to escape every forward slash (&#8220;\&#8221;). Figure 10 is not in Java, so we need to escape the forward-slash character so as not to cause a compilation error. Unfortunately, this process is prone to error and you must do it carefully. You can type in the regular expression first without escaping the forward slashes, and then visually scan the string from left to right and replace every occurrence of the &#8220;\&#8221; character with &#8220;\\&#8221;. To double check, print out the resulting string to the console.</p>
<p>After initializing the strings, instantiate the <code>PatternCompiler</code> object and create a <code>Pattern</code> object by using the <code>PatternCompiler</code> to compile the regular expression:</p>
<div id="codewrap">
<div id="codewrap246">
<pre>      PatternCompiler compiler=new Perl5Compiler();
        Pattern pattern=compiler.compile(regexp);
</pre>
</div>
</div>
<p>Now, create the <code>PatternMatcher</code> object and call the <code>contain()</code> method in the <code>PatternMatcher</code> interface to see if you have a match:</p>
<div id="codewrap">
<div id="codewrap253">
<pre>      PatternMatcher matcher=new Perl5Matcher();
        if (matcher.contains(logEntry,pattern)) {
            MatchResult result=matcher.getMatch();
            System.out.println("IP: "+result.group(1));
            System.out.println("Timestamp: "+result.group(2));
        }
</pre>
</div>
</div>
<p>Next, print out the matched groups using the <code>MatchResult</code> object returned from the <code>PatternMatcher</code> interface. Since the <code>logEntry</code> string contains the pattern to be matched, you could expect the following output:</p>
<div id="codewrap">
<div id="codewrap260">
<pre>        IP: 172.26.155.241
        Timestamp: 26/Feb/2001:10:56:03 -0500
</pre>
</div>
</div>
<h3>HTML processing</h3>
<p>Your next task is to churn through your company&#8217;s HTML pages and perform an analysis of all of a font tag&#8217;s attributes. The                         typical font tag in your HTML looks like this:</p>
<div id="codewrap">
<div id="codewrap265">
<pre>        &lt;font face="Arial, Serif" size="+2" color="red"&gt;
</pre>
</div>
</div>
<p>Your program will print out the attributes for every font tag encountered in the following format:</p>
<div id="codewrap">
<div id="codewrap269">
<pre>        face=Arial, Serif
        size=+2
        color=red
</pre>
</div>
</div>
<p>In this case, I would suggest that you use two regular expressions. The first, shown in Figure 11, extracts <code>"face="Arial, Serif" size="+2" color="red"</code> from the font tag:</p>
<p><img src="http://www.javaworld.com/javaworld/jw-07-2001/images/jw-0713-HTMLA1.gif" alt="" width="572" height="139" /></p>
<p><strong>Figure 11. Matches: The all-attribute part of the font tag</strong></p>
<p>The second regular expression, shown in Figure 12, breaks down each individual attribute into a name-value pair:</p>
<p><img src="http://www.javaworld.com/javaworld/jw-07-2001/images/jw-0713-HTMLA2.gif" alt="" width="573" height="161" /></p>
<p><strong>Figure 12. Matches: Each individual attribute, broken down into a name-value pair</strong></p>
<p>Figure 12 breaks into:</p>
<div id="codewrap">
<div id="codewrap286">
<pre>        font    Arial, Serif
        size    +2
        color   red
</pre>
</div>
</div>
<p>Let&#8217;s now discuss the code to achieve this. First, create the two regular expression strings and compile them into a <code>Pattern</code> object using the <code>Perl5Compiler</code>. Use the <code>Perl5Compiler.CASE_INSENSITIVE_MASK</code> option here when compiling the regular expression for a case-insensitive match.</p>
<p>Next, create a <code>Perl5Matcher</code> object to perform matching:</p>
<div id="codewrap">
<div id="codewrap295">
<pre>        String regexpForFontTag="&lt;\\s*font\\s+([^&gt;]*)\\s*&gt;";
        String regexpForFontAttrib="([a-z]+)\\s*=\\s*\"([^\"]+)\"";
        PatternCompiler compiler=new Perl5Compiler();
        Pattern patternForFontTag=compiler.compile(regexpForFontTag,Perl5Compiler.CASE_INSENSITIVE_MASK);
        Pattern patternForFontAttrib=compiler.compile(regexpForFontAttrib,Perl5Compiler.CASE_INSENSITIVE_MASK);
        PatternMatcher matcher=new Perl5Matcher();
</pre>
</div>
</div>
<p>Assume you have a variable called <code>html</code> of type <code>String</code> that represents a line in the HTML file. If the content of the <code>html</code> string contains the font tag, the matcher will return <code>true</code>, and you&#8217;ll use the <code>MatchResult</code> object returned from the matcher object to get your first group, which includes all of your font attributes:</p>
<div id="codewrap">
<div id="codewrap304">
<pre>        if (matcher.contains(html,patternForFontTag)) {
            MatchResult result=matcher.getMatch();
            String attribs=result.group(1);
            PatternMatcherInput input=new PatternMatcherInput(attribs);
            while (matcher.contains(input,patternForFontAttrib)) {
                result=matcher.getMatch();
                System.out.println(result.group(1)+": "+result.group(2));
            }
        }
</pre>
</div>
</div>
<p>Next, create a <code>PatternMatcherInput</code> object. As previously mentioned, this object lets you continue matching from where the last match was found in the string;                         thus, it&#8217;s perfect for extracting the font tag&#8217;s name-value pair. Create a <code>PatternMatcherInput</code> object by passing in the string to be matched. Then, use the matcher instance to extract each font attribute as it is encountered. This is done by repeatedly calling the <code>contains()</code> method of the <code>PatternMatcher</code> object with the <code>PatternMatcherInput</code> object instead of a string. Every iteration through the <code>PatternMatcherInput</code> object will advance a pointer within it, so the next test will start where the previous one left off.</p>
<p>The output of the example is as follows:</p>
<div id="codewrap">
<div id="codewrap315">
<pre>        face: Arial, Serif
        size: +1
        color: red
</pre>
</div>
</div>
<h3>More HTML processing</h3>
<p>Let&#8217;s continue with another HTML example. This time, imagine that your Web server has moved from <code>widgets.acme.com</code> to <code>newserver.acme.com</code>. You&#8217;ll need to change the links on some of your Webpages from:</p>
<div id="codewrap">
<div id="codewrap322">
<pre>&lt;a href="http://widgets.acme.com/interface.html#How_To_Buy"&gt;
&lt;a href="http://widgets.acme.com/interface.html#How_To_Sell"&gt;
etc.
</pre>
</div>
</div>
<p>to</p>
<div id="codewrap">
<div id="codewrap326">
<pre>&lt;a href="http://newserver.acme.com/interface.html#How_To_Buy"&gt;
&lt;a href="http://newserver.acme.com/interface.html#How_To_Sell"&gt;
etc.
</pre>
</div>
</div>
<p>The regular expression to perform the search is shown in <a href="http://www.javaworld.com/javaworld/jw-07-2001/images/jw-0713-HTMLB.gif" target="_blank">Figure 13</a>.</p>
<table border="0" cellspacing="4" cellpadding="4" width="200" align="right">
<tbody>
<tr>
<td align="center"><a href="http://www.javaworld.com/javaworld/jw-07-2001/images/jw-0713-HTMLB.gif" target="_blank"><img src="http://www.javaworld.com/javaworld/jw-07-2001/images/jw-0713-HTMLB_sml.gif" alt="" /></a><br />
<strong><span>Figure 13. Matches: The link &#8220;http://widgets.acme.com/interface.html#(any anchor). Click on thumbnail to view full-size image.                                     (30 KB)</span></strong></td>
</tr>
</tbody>
</table>
<p>If this regular expression is found, you can make your substitution for the link in Figure 13 with the following expression:</p>
<div id="codewrap">
<div id="codewrap342">
<pre>&lt;a href="http://newserver.acme.com/interface.html#"&gt;
</pre>
</div>
</div>
<p>Notice that you use after the <code>#</code> character. Perl regular expression syntax uses , , and so forth to represent groups that have been matched and extracted. The expression shown in Figure 13 appends whatever text has been matched and extracted as Group 1 to the link.</p>
<p>Now, back to Java. As usual, you must create your testing strings, the necessary object for compiling the regular expression                         into a <code>Pattern</code> object, and a <code>PatternMatcher</code> object:</p>
<div id="codewrap">
<div id="codewrap350">
<pre>        String link="&lt;a href=\"http://widgets.acme.com/interface.html#How_To_Trade\"&gt;";
        String regexpForLink="&lt;\\s*a\\s+href\\s*=\\s*\"http://widgets.acme.com/interface.html#([^\"]+)\"&gt;";
        PatternCompiler compiler=new Perl5Compiler();
        Pattern patternForLink=compiler.compile(regexpForLink,Perl5Compiler.CASE_INSENSITIVE_MASK);
        PatternMatcher matcher=new Perl5Matcher();
</pre>
</div>
</div>
<p>Next, use the static method <code>substitute()</code> from the <code>Util</code> class in the <code>com.oroinc.text.regex</code> package for performing a substitution, and print out the resulting string:</p>
<div id="codewrap">
<div id="codewrap357">
<pre>        String result=Util.substitute(matcher,
                                      patternForLink,
                                      new Perl5Substitution(
                                        "&lt;a href=\"http://newserver.acme.com/interface.html#\"&gt;"),
                                      link,
                                      Util.SUBSTITUTE_ALL);
        System.out.println(result);
</pre>
</div>
</div>
<p>The syntax of the <code>Util.substitute()</code> method is as follows:</p>
<div id="codewrap">
<div id="codewrap362">
<pre>        public static String substitute(PatternMatcher matcher,
                                        Pattern pattern,
                                        Substitution sub,
                                        String input,
                                        int numSubs)
</pre>
</div>
</div>
<p>The first two parameters for this call are the <code>PatternMatcher</code> and <code>Pattern</code> objects created earlier. The input for the third parameter is a <code>Substitution</code> object that determines how the substitution is to be performed. In this case, use the <code>Perl5Substitution</code> object, which lets you use a Perl 5-style substitution. The fourth parameter is the actual string on which you wish to perform the substitution, and the last parameter lets you specify whether you wish to substitute on every occurrence of the pattern found (<code>Util.SUBSTITUTE_ALL</code>) or only substitute a specified number of times.</p>
<h3>About the author</h3>
<p>Benedict Chng is a                      Sun-certified developer currently consulting in the Boston area. He                      hails from sunny and tropical Singapore and has been working in the                      software development field for close to four years. His current                      interests include writing applications for Palm devices and                      sightseeing in the New England region.</p>
<h3>Express yourself</h3>
<p>In this article, I&#8217;ve shown you the powerful features of regular expressions. When used appropriately, they can help a great deal in string extraction and text changes. I have also shown how you can incorporate regular expressions into your Java application using the open source Jakarta-ORO library. Now, it&#8217;s up to you to decide whether the old string manipulation approach (using <code>StringTokenizers</code>, <code>charAt,</code> or <code>substring</code>) or a regular expression library, like Jakarta-ORO, works for you.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/javatage.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/javatage.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/javatage.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/javatage.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/javatage.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/javatage.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/javatage.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/javatage.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/javatage.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/javatage.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/javatage.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/javatage.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/javatage.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/javatage.wordpress.com/93/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javatage.wordpress.com&amp;blog=14168910&amp;post=93&amp;subd=javatage&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://javatage.wordpress.com/2010/06/14/rexeg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9092b46f52fa83ab1129bf9b45c78393?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">javatage</media:title>
		</media:content>

		<media:content url="http://www.javaworld.com/javaworld/jw-07-2001/images/jw-0713-SSN1.gif" medium="image" />

		<media:content url="http://www.javaworld.com/javaworld/jw-07-2001/images/jw-0713-SSN2.gif" medium="image" />

		<media:content url="http://www.javaworld.com/javaworld/jw-07-2001/images/jw-0713-Carplate.gif" medium="image" />

		<media:content url="http://www.javaworld.com/javaworld/jw-07-2001/images/jw-0713-NoXWord.gif" medium="image" />

		<media:content url="http://www.javaworld.com/javaworld/jw-07-2001/images/jw-0713-BirthDate1.gif" medium="image" />

		<media:content url="http://www.javaworld.com/javaworld/jw-07-2001/images/jw-0713-BirthDate2.gif" medium="image" />

		<media:content url="http://www.javaworld.com/javaworld/jw-07-2001/images/jw-0713-SSN3.gif" medium="image" />

		<media:content url="http://www.javaworld.com/javaworld/jw-07-2001/images/jw-0713-IP1.gif" medium="image" />

		<media:content url="http://www.javaworld.com/javaworld/jw-07-2001/images/jw-0713-IP2.gif" medium="image" />

		<media:content url="http://www.javaworld.com/javaworld/jw-07-2001/images/jw-0713-IP3_sml.gif" medium="image" />

		<media:content url="http://www.javaworld.com/javaworld/jw-07-2001/images/jw-0713-HTMLA1.gif" medium="image" />

		<media:content url="http://www.javaworld.com/javaworld/jw-07-2001/images/jw-0713-HTMLA2.gif" medium="image" />

		<media:content url="http://www.javaworld.com/javaworld/jw-07-2001/images/jw-0713-HTMLB_sml.gif" medium="image" />
	</item>
		<item>
		<title>Building a webpage tutorial</title>
		<link>http://javatage.wordpress.com/2010/06/13/building-a-webpage-tutorial/</link>
		<comments>http://javatage.wordpress.com/2010/06/13/building-a-webpage-tutorial/#comments</comments>
		<pubDate>Sun, 13 Jun 2010 22:51:40 +0000</pubDate>
		<dc:creator>javatage</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://javatage.wordpress.com/?p=88</guid>
		<description><![CDATA[stuff here<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javatage.wordpress.com&amp;blog=14168910&amp;post=88&amp;subd=javatage&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>stuff here</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/javatage.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/javatage.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/javatage.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/javatage.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/javatage.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/javatage.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/javatage.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/javatage.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/javatage.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/javatage.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/javatage.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/javatage.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/javatage.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/javatage.wordpress.com/88/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javatage.wordpress.com&amp;blog=14168910&amp;post=88&amp;subd=javatage&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://javatage.wordpress.com/2010/06/13/building-a-webpage-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9092b46f52fa83ab1129bf9b45c78393?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">javatage</media:title>
		</media:content>
	</item>
		<item>
		<title>Document declarations and internet explorer</title>
		<link>http://javatage.wordpress.com/2010/06/13/document-declarations-and-internet-explorer/</link>
		<comments>http://javatage.wordpress.com/2010/06/13/document-declarations-and-internet-explorer/#comments</comments>
		<pubDate>Sun, 13 Jun 2010 22:48:57 +0000</pubDate>
		<dc:creator>javatage</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://javatage.wordpress.com/?p=85</guid>
		<description><![CDATA[need doctype or won&#8217;t read css properly<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javatage.wordpress.com&amp;blog=14168910&amp;post=85&amp;subd=javatage&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>need doctype or won&#8217;t read css properly</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/javatage.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/javatage.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/javatage.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/javatage.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/javatage.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/javatage.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/javatage.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/javatage.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/javatage.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/javatage.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/javatage.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/javatage.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/javatage.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/javatage.wordpress.com/85/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javatage.wordpress.com&amp;blog=14168910&amp;post=85&amp;subd=javatage&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://javatage.wordpress.com/2010/06/13/document-declarations-and-internet-explorer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9092b46f52fa83ab1129bf9b45c78393?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">javatage</media:title>
		</media:content>
	</item>
		<item>
		<title>Getting up and running with GWT and Netbeans</title>
		<link>http://javatage.wordpress.com/2010/06/13/getting-up-and-running-with-gwt-and-netbeans/</link>
		<comments>http://javatage.wordpress.com/2010/06/13/getting-up-and-running-with-gwt-and-netbeans/#comments</comments>
		<pubDate>Sun, 13 Jun 2010 20:20:11 +0000</pubDate>
		<dc:creator>javatage</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://javatage.wordpress.com/?p=80</guid>
		<description><![CDATA[Get an install of GWT up and running During my growing experience with GWT i learned that it is better to create the project from scratch and import it into the IDE rather then using a IDE-wizard which often creates &#8230; <a href="http://javatage.wordpress.com/2010/06/13/getting-up-and-running-with-gwt-and-netbeans/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javatage.wordpress.com&amp;blog=14168910&amp;post=80&amp;subd=javatage&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Get an install of GWT up and running</p>
<p><span id="more-80"></span></p>
<p>During my growing experience with GWT i learned that it is better to create the project from scratch and import it into the IDE rather then using a IDE-wizard which often creates not all files you need. So let’s start bei downloading the <a href="http://code.google.com/intl/de-DE/webtoolkit/download.html" target="_blank">Google Web Toolkit Archive</a> and extract it. Open a shell (Windows-User run “<strong>cmd</strong>“) and navigate to the directory where you have extracted the GWT-archive. Run the following commands:</p>
<ul>
<li>webAppCreator.cmd -out MyProjectDirectory eu.jdevelop.gwt.MyApp</li>
<li>i18nCreator.cmd -eclipse MyGwtProject -createMessages -out MyProjectDirectory eu.jdevelop.gwt.client.constants.i18n.MyLanguageConstants</li>
</ul>
<p>So what have you done? You have created a GWT-Project and added support for Eclipse and internationalization (i18n).<br />
<strong> </strong></p>
<div id="attachment_406"><a href="http://blog.jdevelop.eu/uploads/2009/11/1_create_project.png" target="_blank"><img title="Create the Project" src="http://blog.jdevelop.eu/uploads/2009/11/1_create_project-150x150.png" alt="Create the Project" width="150" height="150" /></a>Create the Project</p>
</div>
<p><strong> </strong><br />
Change into the created directory <strong>MyProjectDirectory </strong>and run the following commands to see that all is working:</p>
<ul>
<li>ant build</li>
<li>ant hosted</li>
</ul>
<div id="attachment_407"><a href="http://blog.jdevelop.eu/uploads/2009/11/2_ant.png" target="_blank"><img title="Running Ant targets" src="http://blog.jdevelop.eu/uploads/2009/11/2_ant-150x150.png" alt="Running Ant targets" width="150" height="150" /></a>Running Ant targets</p>
</div>
<p><strong> </strong></p>
<div id="attachment_408"><a href="http://blog.jdevelop.eu/uploads/2009/11/3_hosted.png" target="_blank"><img title="Hosted Mode" src="http://blog.jdevelop.eu/uploads/2009/11/3_hosted-150x150.png" alt="Hosted Mode" width="150" height="150" /></a>Hosted Mode</p>
</div>
<p><strong> </strong><br />
Well done, now it is time to import this project into your favourite IDE.</p>
<p><strong>Using NetBeans</strong><br />
<strong> </strong><br />
Using NetBeans and GWT is not very difficult. Here i am using NetBeans v6.7.1 . First open in the menu “<strong>Tools</strong>“-&gt;”<strong>Plugins</strong>” and install the <a href="http://gwt4nb.dev.java.net/" target="_blank">GWT4NB</a>-Plugin.<br />
<strong> </strong></p>
<div id="attachment_423"><a href="http://blog.jdevelop.eu/uploads/2009/11/10_netbeans_plugin.png" target="_blank"><img title="Install the NetBeans Plugin" src="http://blog.jdevelop.eu/uploads/2009/11/10_netbeans_plugin-150x150.png" alt="Install the NetBeans Plugin" width="150" height="150" /></a>Install the NetBeans Plugin</p>
</div>
<p><strong> </strong><br />
Create a new “<strong>Web Application</strong>“-Project:<br />
<strong> </strong></p>
<div id="attachment_425"><a href="http://blog.jdevelop.eu/uploads/2009/11/11_webapp.png" target="_blank"><img title="Web Application" src="http://blog.jdevelop.eu/uploads/2009/11/11_webapp-150x150.png" alt="Web Application" width="150" height="150" /></a>Web Application</p>
</div>
<p><strong> </strong><br />
Choose a directory for it:<br />
<strong> </strong></p>
<div id="attachment_426"><a href="http://blog.jdevelop.eu/uploads/2009/11/12_directory.png" target="_blank"><img title="Directory" src="http://blog.jdevelop.eu/uploads/2009/11/12_directory-150x150.png" alt="Directory" width="150" height="150" /></a>Directory</p>
</div>
<p><strong> </strong><br />
Select a Server:<br />
<strong> </strong></p>
<div id="attachment_427"><a href="http://blog.jdevelop.eu/uploads/2009/11/13_server.png" target="_blank"><img title="Server" src="http://blog.jdevelop.eu/uploads/2009/11/13_server-150x150.png" alt="Server" width="150" height="150" /></a>Server</p>
</div>
<p><strong> </strong><br />
Select the “<strong>Google Web Toolkit</strong>“-Framework in the next page and insert in the “<strong>GWT Module</strong>“-Textfield this: “<strong>eu.jdevelop.gwt.MyApp</strong>“. Notice the missing “<strong>client</strong>“-subpackage? It will be automatically created by the GWT4NB-Plugin.<br />
<strong> </strong></p>
<div id="attachment_428"><a href="http://blog.jdevelop.eu/uploads/2009/11/14_framework.png" target="_blank"><img title="GWT Framework" src="http://blog.jdevelop.eu/uploads/2009/11/14_framework-150x150.png" alt="GWT Framework" width="150" height="150" /></a>GWT Framework</p>
</div>
<p><strong> </strong><br />
After that you will see the created project from the GWT4NB-Plugin:<br />
<strong> </strong></p>
<div id="attachment_429"><a href="http://blog.jdevelop.eu/uploads/2009/11/15_netbeans_project.png" target="_blank"><img title="GWT4NB Project" src="http://blog.jdevelop.eu/uploads/2009/11/15_netbeans_project-150x150.png" alt="GWT4NB Project" width="150" height="150" /></a>GWT4NB Project</p>
</div>
<p><strong> </strong><br />
When you launch the application you can see that it is deployed into your previously selected Server:<br />
<strong> </strong></p>
<div id="attachment_432"><a href="http://blog.jdevelop.eu/uploads/2009/11/16_running_server.png" target="_blank"><img title="Running in Tomcat" src="http://blog.jdevelop.eu/uploads/2009/11/16_running_server-150x150.png" alt="Running in Tomcat" width="150" height="150" /></a>Running in Tomcat</p>
</div>
<p><strong> </strong></p>
<div id="attachment_433"><a href="http://blog.jdevelop.eu/uploads/2009/11/17_chrome.png" target="_blank"><img title="App in Chrome" src="http://blog.jdevelop.eu/uploads/2009/11/17_chrome-150x150.png" alt="App in Chrome" width="150" height="150" /></a>App in Chrome</p>
</div>
<p><strong> </strong><br />
Where is now the “<strong>hosted mode</strong>” ? To use it, only click on the <strong>Debug</strong>-Button in the menu. To use Ant-Targets you have to make some changes. First open the “<strong>project properties</strong>” and change the “<strong>web page folder</strong>” from “<strong>web</strong>” to “<strong>war</strong>“:<br />
<strong> </strong></p>
<div id="attachment_434"><a href="http://blog.jdevelop.eu/uploads/2009/11/18_war.png" target="_blank"><img title="Change the directory" src="http://blog.jdevelop.eu/uploads/2009/11/18_war-150x150.png" alt="Change the directory" width="150" height="150" /></a>Change the directory</p>
</div>
<p><strong> </strong><br />
Open the file “<strong>build.xml</strong>“, located inside your GWT-Project (created in <a href="http://blog.jdevelop.eu/2009/11/11/create-a-gwt-application-from-scratch/#project">Create the Project-files</a>):<br />
<strong> </strong></p>
<div id="attachment_436"><a href="http://blog.jdevelop.eu/uploads/2009/11/19_original_buildxml.png" target="_blank"><img title="Original build.xml" src="http://blog.jdevelop.eu/uploads/2009/11/19_original_buildxml-150x150.png" alt="Original build.xml" width="150" height="150" /></a>Original build.xml</p>
</div>
<p><strong> </strong><br />
Copy the content inside the “<strong>&lt;project&gt;&lt;/project&gt;</strong>“-tags and insert it into the “<strong>build.xml</strong>“-file, located in your NetBeans-Project directory:<strong> </strong><br />
<strong> </strong></p>
<div id="attachment_437"><a href="http://blog.jdevelop.eu/uploads/2009/11/20_changed_buildxml.png" target="_blank"><img title="Changed build.xml" src="http://blog.jdevelop.eu/uploads/2009/11/20_changed_buildxml-150x150.png" alt="Changed build.xml" width="150" height="150" /></a>Changed build.xml</p>
</div>
<p><strong> </strong><br />
Replace all appearances of “<strong>src</strong>” with “<strong>src/java</strong>“, because source files are located in a different directory.<br />
<strong> </strong></p>
<div id="attachment_440"><a href="http://blog.jdevelop.eu/uploads/2009/11/21_replace_content.png" target="_blank"><img title="Search and replace" src="http://blog.jdevelop.eu/uploads/2009/11/21_replace_content-150x150.png" alt="Search and replace" width="150" height="150" /></a>Search and replace</p>
</div>
<p><strong> </strong><br />
You are now able to run the new ant targets “<strong>gwtc</strong>” and “<strong>hosted</strong>“:<br />
<strong> </strong></p>
<div id="attachment_442"><a href="http://blog.jdevelop.eu/uploads/2009/11/22_new_targets.png" target="_blank"><img title="new ant targets" src="http://blog.jdevelop.eu/uploads/2009/11/22_new_targets-150x150.png" alt="new ant targets" width="150" height="150" /></a>new ant targets</p>
</div>
<p><strong> </strong><br />
The last step is the integration of i18n. Copy the whole “<strong>…gwt-windows-1.7.1\MyProjectDirectory\src\eu\jdevelop\gwt\client\<em>constants\</em></strong>“-directory into the corresponding directory of your NetBeans-project.<br />
<strong> </strong></p>
<div id="attachment_445"><a href="http://blog.jdevelop.eu/uploads/2009/11/23_i18n.png" target="_blank"><img title="Copied content" src="http://blog.jdevelop.eu/uploads/2009/11/23_i18n-150x150.png" alt="Copied content" width="150" height="150" /></a>Copied content</p>
</div>
<p><strong> </strong><br />
Don’t forget to copy the file “<strong>MyLanguageConstants-i18n.cmd</strong>“, you need it to create the i18n-java-file! You have to open it in NetBeans and update the source-directory (there are two!) to “<strong>src/java</strong>“:<br />
<strong> </strong></p>
<div id="attachment_446"><a href="http://blog.jdevelop.eu/uploads/2009/11/24_i18nfile.png" target="_blank"><img title="Edit the i18n-file" src="http://blog.jdevelop.eu/uploads/2009/11/24_i18nfile-150x150.png" alt="Edit the i18n-file" width="150" height="150" /></a>Edit the i18n-file</p>
</div>
<p><strong> </strong></p>
<div id="attachment_448"><a href="http://blog.jdevelop.eu/uploads/2009/11/25_netbeans_hostedmode.png" target="_blank"><img title="Hosted mode in NetBeans" src="http://blog.jdevelop.eu/uploads/2009/11/25_netbeans_hostedmode-150x150.png" alt="Hosted mode in NetBeans" width="150" height="150" /></a>Hosted mode in NetBeans</p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/javatage.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/javatage.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/javatage.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/javatage.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/javatage.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/javatage.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/javatage.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/javatage.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/javatage.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/javatage.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/javatage.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/javatage.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/javatage.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/javatage.wordpress.com/80/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javatage.wordpress.com&amp;blog=14168910&amp;post=80&amp;subd=javatage&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://javatage.wordpress.com/2010/06/13/getting-up-and-running-with-gwt-and-netbeans/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9092b46f52fa83ab1129bf9b45c78393?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">javatage</media:title>
		</media:content>

		<media:content url="http://blog.jdevelop.eu/uploads/2009/11/1_create_project-150x150.png" medium="image">
			<media:title type="html">Create the Project</media:title>
		</media:content>

		<media:content url="http://blog.jdevelop.eu/uploads/2009/11/2_ant-150x150.png" medium="image">
			<media:title type="html">Running Ant targets</media:title>
		</media:content>

		<media:content url="http://blog.jdevelop.eu/uploads/2009/11/3_hosted-150x150.png" medium="image">
			<media:title type="html">Hosted Mode</media:title>
		</media:content>

		<media:content url="http://blog.jdevelop.eu/uploads/2009/11/10_netbeans_plugin-150x150.png" medium="image">
			<media:title type="html">Install the NetBeans Plugin</media:title>
		</media:content>

		<media:content url="http://blog.jdevelop.eu/uploads/2009/11/11_webapp-150x150.png" medium="image">
			<media:title type="html">Web Application</media:title>
		</media:content>

		<media:content url="http://blog.jdevelop.eu/uploads/2009/11/12_directory-150x150.png" medium="image">
			<media:title type="html">Directory</media:title>
		</media:content>

		<media:content url="http://blog.jdevelop.eu/uploads/2009/11/13_server-150x150.png" medium="image">
			<media:title type="html">Server</media:title>
		</media:content>

		<media:content url="http://blog.jdevelop.eu/uploads/2009/11/14_framework-150x150.png" medium="image">
			<media:title type="html">GWT Framework</media:title>
		</media:content>

		<media:content url="http://blog.jdevelop.eu/uploads/2009/11/15_netbeans_project-150x150.png" medium="image">
			<media:title type="html">GWT4NB Project</media:title>
		</media:content>

		<media:content url="http://blog.jdevelop.eu/uploads/2009/11/16_running_server-150x150.png" medium="image">
			<media:title type="html">Running in Tomcat</media:title>
		</media:content>

		<media:content url="http://blog.jdevelop.eu/uploads/2009/11/17_chrome-150x150.png" medium="image">
			<media:title type="html">App in Chrome</media:title>
		</media:content>

		<media:content url="http://blog.jdevelop.eu/uploads/2009/11/18_war-150x150.png" medium="image">
			<media:title type="html">Change the directory</media:title>
		</media:content>

		<media:content url="http://blog.jdevelop.eu/uploads/2009/11/19_original_buildxml-150x150.png" medium="image">
			<media:title type="html">Original build.xml</media:title>
		</media:content>

		<media:content url="http://blog.jdevelop.eu/uploads/2009/11/20_changed_buildxml-150x150.png" medium="image">
			<media:title type="html">Changed build.xml</media:title>
		</media:content>

		<media:content url="http://blog.jdevelop.eu/uploads/2009/11/21_replace_content-150x150.png" medium="image">
			<media:title type="html">Search and replace</media:title>
		</media:content>

		<media:content url="http://blog.jdevelop.eu/uploads/2009/11/22_new_targets-150x150.png" medium="image">
			<media:title type="html">new ant targets</media:title>
		</media:content>

		<media:content url="http://blog.jdevelop.eu/uploads/2009/11/23_i18n-150x150.png" medium="image">
			<media:title type="html">Copied content</media:title>
		</media:content>

		<media:content url="http://blog.jdevelop.eu/uploads/2009/11/24_i18nfile-150x150.png" medium="image">
			<media:title type="html">Edit the i18n-file</media:title>
		</media:content>

		<media:content url="http://blog.jdevelop.eu/uploads/2009/11/25_netbeans_hostedmode-150x150.png" medium="image">
			<media:title type="html">Hosted mode in NetBeans</media:title>
		</media:content>
	</item>
		<item>
		<title>Changing your MySQL database location</title>
		<link>http://javatage.wordpress.com/2010/06/13/changing-your-mysql-database-location/</link>
		<comments>http://javatage.wordpress.com/2010/06/13/changing-your-mysql-database-location/#comments</comments>
		<pubDate>Sun, 13 Jun 2010 20:14:41 +0000</pubDate>
		<dc:creator>javatage</dc:creator>
				<category><![CDATA[Odds and ends]]></category>

		<guid isPermaLink="false">http://javatage.wordpress.com/?p=74</guid>
		<description><![CDATA[For various reason you may find you need to change the location where your database is stored. Here&#8217;s how you do that. Identify the database files you wish to migrate into the new data directory You can use the following &#8230; <a href="http://javatage.wordpress.com/2010/06/13/changing-your-mysql-database-location/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javatage.wordpress.com&amp;blog=14168910&amp;post=74&amp;subd=javatage&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For various reason you may find you need to change the location where your database is stored. Here&#8217;s how you do that.</p>
<ul>
<li>Identify the database files you wish to migrate into the new data directory<br />
You can use the following command to list the current databases in mysql</p>
<pre>mysqlshow -u root -p</pre>
<p>Keep this list available as you will reference it in a later step</li>
<li>Shutdown the MySQL database, if it is running</li>
<pre>mysqladmin -u root -p shutdown</pre>
<li>Locate the MySQL configuration file. This is usually located in the directory $OSS_HOME/var/mysql</li>
<p><em>Note: Always a good idea to make a copy of the config file before making any changes. *<br />
</em></p>
<p>The property you need to change is named <em>datadir</em>. The default value is $OSS_HOME/var/mysql, which places the database files in the same directory as the log files and other runtime generated files. This property is usually located in the [mysqld_safe] section in the configuration file<br />
You need to change:</p>
<pre>[mysqld_safe]
datadir      = /opt/oss/var/mysql
</pre>
<p>to</p>
<pre>[mysqld_safe]
datadir      = /opt/oss/var/mysql/data
</pre>
<li>Save these changes</li>
<li>Create the directory you specified in the datadir property</li>
<pre>mkdir -p /optoss/var/mysql/data</pre>
<li>Check to make sure the user assigned to execute mysql has read/write privileges on this directory<br />
You may need to modify the directory settings using chown and chmod</li>
<li>Move the databases listed in the first step to the new data directory</li>
<pre>mv test /opt/oss/var/mysql/data</pre>
<p><em>Note: You can use the copy (cp) command instead if you prefer. Remember to remove the copied files once the migration is complete</em><br />
You will need to move/copy each database into the new data directory</p>
<li>After all the databases have been migrated to the new data directory, you should start MySQL</li>
<pre>openpkg rc mysql start</pre>
<p>The database files will now be managed under the new data directory. If you encounter any problems during startup, you check the hostname.err file located in the data directory.</p>
<li>Think about Apparmor<br />
If you are using some security software like Apparmor (which is installed on major default server distributions), think about editing the appropriate configuratio file</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/javatage.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/javatage.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/javatage.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/javatage.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/javatage.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/javatage.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/javatage.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/javatage.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/javatage.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/javatage.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/javatage.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/javatage.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/javatage.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/javatage.wordpress.com/74/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javatage.wordpress.com&amp;blog=14168910&amp;post=74&amp;subd=javatage&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://javatage.wordpress.com/2010/06/13/changing-your-mysql-database-location/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9092b46f52fa83ab1129bf9b45c78393?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">javatage</media:title>
		</media:content>
	</item>
		<item>
		<title>Creating your own Joomla module</title>
		<link>http://javatage.wordpress.com/2010/06/12/creating-your-own-joomla-module/</link>
		<comments>http://javatage.wordpress.com/2010/06/12/creating-your-own-joomla-module/#comments</comments>
		<pubDate>Sat, 12 Jun 2010 17:23:59 +0000</pubDate>
		<dc:creator>javatage</dc:creator>
				<category><![CDATA[Odds and ends]]></category>

		<guid isPermaLink="false">http://javatage.wordpress.com/?p=51</guid>
		<description><![CDATA[This covers the basics of module creation for those times you want your own HTML, javascript or CSS in the module. You could of course go into the Template and edit but there&#8217;s a much easier and better way. Put &#8230; <a href="http://javatage.wordpress.com/2010/06/12/creating-your-own-joomla-module/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javatage.wordpress.com&amp;blog=14168910&amp;post=51&amp;subd=javatage&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This covers the basics of module creation for those times you want your own HTML, javascript or CSS in the module. You could of course go into the Template and edit but there&#8217;s a much easier and better way.</p>
<p><strong>Put it into a Module</strong></p>
<p>This is the easiest way to create a module yourself, it won&#8217;t have any parameters to set, besides the standard.<br />
But in the standard there is already a positioning parameter.</p>
<p><strong>Making the Module<br />
</strong></p>
<p>Log into to the back-end, and change your configuration to work <em>without a Wysiwig editor.<br />
</em>Unless you work with JoolaFCK, that can handle pure coding within the &#8220;code&#8221; mode without any trouble.</p>
<p>In the &#8220;module&#8221; section click on &#8220;new&#8221;.<br />
Give it an easy to remember and relevant name.<br />
The code you want to implement goes in the text area. With the Wysiwyg editor off none of your input will be stripped of its markup.</p>
<p>Save it and publish, then check your site to see if it is looks the way you want.<br />
Otherwise, go back and change the coding.</p>
<p>Your done! You just made your own Joomla Module!</p>
<p>Remember to set your configuration back on wysiwig before creating more content.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/javatage.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/javatage.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/javatage.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/javatage.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/javatage.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/javatage.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/javatage.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/javatage.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/javatage.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/javatage.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/javatage.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/javatage.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/javatage.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/javatage.wordpress.com/51/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javatage.wordpress.com&amp;blog=14168910&amp;post=51&amp;subd=javatage&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://javatage.wordpress.com/2010/06/12/creating-your-own-joomla-module/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9092b46f52fa83ab1129bf9b45c78393?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">javatage</media:title>
		</media:content>
	</item>
		<item>
		<title>Java race runner exercise</title>
		<link>http://javatage.wordpress.com/2010/06/12/java-race-runner-exercise/</link>
		<comments>http://javatage.wordpress.com/2010/06/12/java-race-runner-exercise/#comments</comments>
		<pubDate>Sat, 12 Jun 2010 17:14:04 +0000</pubDate>
		<dc:creator>javatage</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://javatage.wordpress.com/?p=48</guid>
		<description><![CDATA[The results of the mens 400m heats from the 2007 IAAF World Championships in Osaka have been stored in the file osaka.txt. For each heat, the file contains the following information about each athlete: lane number competition number {worn on &#8230; <a href="http://javatage.wordpress.com/2010/06/12/java-race-runner-exercise/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javatage.wordpress.com&amp;blog=14168910&amp;post=48&amp;subd=javatage&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The results of the mens 400m heats from the 2007 IAAF World Championships in Osaka have been stored in the file <a href="https://intranet.cscs.wmin.ac.uk/modules/3sfe402/ecsc401/osaka.txt">osaka.txt</a>. For each heat, the file contains the following information about each athlete:</p>
<ul>
<li>lane number</li>
<li>competition number {worn on      vest}</li>
<li>name</li>
<li>nationality {3 character      abbreviation}</li>
<li>time for the race {seconds}</li>
</ul>
<p>The fastest three athletes from each heat automatically qualified for the next round, along with the three overall fastest &#8220;losers&#8221;, so that 24 athletes progressed to the next round of the competition.</p>
<p><strong>You are asked to write, in Java :</strong><strong> </strong></p>
<ul>
<li>a method to read the data      from the file and store it in a suitable way.</li>
<li>a method which lists the      fastest three athletes from one heat.</li>
<li>a main method which uses these two methods and establishes which twenty four athletes would progress to the next round of the competition.</li>
</ul>
<p>So here&#8217;s what i did.</p>
<p>The runner class.</p>
<pre>/*
    Class                : Runner.java

    Written by            : Michael Daly

    Student ID            : 12701966

    Creation date        : 16/12/09

*/

import java.util.logging.*;
import java.util.*;
import java.io.IOException;

/*
   -----------------------------------------------------------------------------
   Runner.java - This class represents a runner object. The runner is read from the
   RaceResults file of data in ArrayLists and commandline display of sorted data
   -----------------------------------------------------------------------------
 */

public class Runner implements Comparable&lt; Runner &gt;
{
    private int lane;
    private int num;
    private String name;
    private String nationality;
    private Double time;
    private static Logger logger;

    static
    {
        try
        {
            //set up logging
            boolean append = false;
            FileHandler fhrun = new FileHandler();
            fhrun.setFormatter( new SimpleFormatter() );
            logger = Logger.getLogger( "LogFile" );
            logger.addHandler( fhrun );
            logger.setLevel( Level.ALL );
        }
        catch ( IOException e )
        {
            System.out.println( "Instantiation of logging file failed in runner class" );
        }
    }

    /*
       Only constructor. An instance of the class is created by
       passing a list of all required arguments to the constructor.

    */
    public Runner( int lane, int num, String nationality, String name, Double time )
    {
        //logger.entering ("Runner", "Runner", new Object[]{lane, num, nationality, name, time});
        this.lane = lane;
        this.num = num;
        this.nationality = nationality;
        this.name = name;
        this.time = time;
        //logger.exiting ("Runner", "Runner", this.name);
    }

    public int getLane()
    {
        return lane;
    }

    public int getNum()
    {
        return num;
    }

    public String getName()
    {
        return name;
    }

    public String getNation()
    {
        return nationality;
    }

    public Double getTime()
    {

        return time;
    }

    /*
     Compares runner objects and sorts them accordingly.
    */
    public int compareTo( Runner r )
    {
        //logger.entering("Runner" , "compareTo", r.getName());
        return time.compareTo( r.getTime() );
    }

}
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/javatage.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/javatage.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/javatage.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/javatage.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/javatage.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/javatage.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/javatage.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/javatage.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/javatage.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/javatage.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/javatage.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/javatage.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/javatage.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/javatage.wordpress.com/48/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javatage.wordpress.com&amp;blog=14168910&amp;post=48&amp;subd=javatage&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://javatage.wordpress.com/2010/06/12/java-race-runner-exercise/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9092b46f52fa83ab1129bf9b45c78393?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">javatage</media:title>
		</media:content>
	</item>
		<item>
		<title>Dealing with XML and PHP4</title>
		<link>http://javatage.wordpress.com/2010/06/12/cat-1-new-post/</link>
		<comments>http://javatage.wordpress.com/2010/06/12/cat-1-new-post/#comments</comments>
		<pubDate>Sat, 12 Jun 2010 16:52:53 +0000</pubDate>
		<dc:creator>javatage</dc:creator>
				<category><![CDATA[PHP tuts]]></category>

		<guid isPermaLink="false">http://javatage.wordpress.com/?p=42</guid>
		<description><![CDATA[chopping up PHP5 code to run on a PHP4 server install.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javatage.wordpress.com&amp;blog=14168910&amp;post=42&amp;subd=javatage&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>chopping up PHP5 code to run on a PHP4 server install.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/javatage.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/javatage.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/javatage.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/javatage.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/javatage.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/javatage.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/javatage.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/javatage.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/javatage.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/javatage.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/javatage.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/javatage.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/javatage.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/javatage.wordpress.com/42/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javatage.wordpress.com&amp;blog=14168910&amp;post=42&amp;subd=javatage&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://javatage.wordpress.com/2010/06/12/cat-1-new-post/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9092b46f52fa83ab1129bf9b45c78393?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">javatage</media:title>
		</media:content>
	</item>
		<item>
		<title>Setting up network filesharing between OSX, Windows 7 and Ubuntu 10.04</title>
		<link>http://javatage.wordpress.com/2010/06/12/cat-1-post/</link>
		<comments>http://javatage.wordpress.com/2010/06/12/cat-1-post/#comments</comments>
		<pubDate>Sat, 12 Jun 2010 16:49:31 +0000</pubDate>
		<dc:creator>javatage</dc:creator>
				<category><![CDATA[Odds and ends]]></category>

		<guid isPermaLink="false">http://javatage.wordpress.com/?p=39</guid>
		<description><![CDATA[This one proved hairy only on the windows side of things.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javatage.wordpress.com&amp;blog=14168910&amp;post=39&amp;subd=javatage&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This one proved hairy only on the windows side of things.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/javatage.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/javatage.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/javatage.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/javatage.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/javatage.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/javatage.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/javatage.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/javatage.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/javatage.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/javatage.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/javatage.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/javatage.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/javatage.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/javatage.wordpress.com/39/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javatage.wordpress.com&amp;blog=14168910&amp;post=39&amp;subd=javatage&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://javatage.wordpress.com/2010/06/12/cat-1-post/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9092b46f52fa83ab1129bf9b45c78393?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">javatage</media:title>
		</media:content>
	</item>
		<item>
		<title>Hello world!</title>
		<link>http://javatage.wordpress.com/2010/06/12/hello-world/</link>
		<comments>http://javatage.wordpress.com/2010/06/12/hello-world/#comments</comments>
		<pubDate>Sat, 12 Jun 2010 13:28:00 +0000</pubDate>
		<dc:creator>javatage</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://javatage.wordpress.com/?p=1</guid>
		<description><![CDATA[My new home. My move to WordPress&#8217; free blogspots coincides with my move from East London to the easy atmosphere of Bounds Green in North London. An exiting time indeed.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javatage.wordpress.com&amp;blog=14168910&amp;post=1&amp;subd=javatage&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>My new home. My move to WordPress&#8217; free blogspots coincides with my move from East London to the easy atmosphere of Bounds Green in North London. An exiting time indeed.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/javatage.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/javatage.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/javatage.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/javatage.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/javatage.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/javatage.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/javatage.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/javatage.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/javatage.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/javatage.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/javatage.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/javatage.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/javatage.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/javatage.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=javatage.wordpress.com&amp;blog=14168910&amp;post=1&amp;subd=javatage&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://javatage.wordpress.com/2010/06/12/hello-world/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9092b46f52fa83ab1129bf9b45c78393?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">javatage</media:title>
		</media:content>
	</item>
	</channel>
</rss>
