<?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>Gregor Bowie&#039;s Blog</title>
	<atom:link href="http://gregorbowie.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://gregorbowie.wordpress.com</link>
	<description>Random thoughts</description>
	<lastBuildDate>Fri, 27 Jan 2012 15:23:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='gregorbowie.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Gregor Bowie&#039;s Blog</title>
		<link>http://gregorbowie.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://gregorbowie.wordpress.com/osd.xml" title="Gregor Bowie&#039;s Blog" />
	<atom:link rel='hub' href='http://gregorbowie.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Euler Problem 5 &#8211; Weekly Update</title>
		<link>http://gregorbowie.wordpress.com/2012/01/27/euler-problem-5-weekly-update/</link>
		<comments>http://gregorbowie.wordpress.com/2012/01/27/euler-problem-5-weekly-update/#comments</comments>
		<pubDate>Fri, 27 Jan 2012 15:00:01 +0000</pubDate>
		<dc:creator>gregorbowie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://gregorbowie.wordpress.com/?p=478</guid>
		<description><![CDATA[Forgot all about this until just before the deadline, so a little bit of a rushed job. Did try to get another colleague involved, but couldn&#8217;t get them to quite cross the line. The Problem &#8211; Euler Problem 5 2520 is the smallest number that can be divided by each of the numbers from 1 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregorbowie.wordpress.com&amp;blog=9294073&amp;post=478&amp;subd=gregorbowie&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Forgot all about this until just before the deadline, so a little bit of a rushed job. Did try to get another colleague involved, but couldn&#8217;t get them to quite cross the line.</p>
<p><strong>The Problem</strong> &#8211; <a href="http://projecteuler.net/problem=5" target="_blank">Euler Problem 5</a></p>
<p>2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.</p>
<p>What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?</p>
<p><strong>My Solution</strong></p>
<p>Initially I had a couple of thoughts. The raw solution would be to have a for loop, simply test the remainder of the division from 1 to 20.. until the right number was found. This could be coded long handed with numerous indented if&#8230; statements for each of the numbers 1..20. Then a while loop would have presented a better way of avoiding the nested loops. If the counter got to 0 for the while loop, then I&#8217;d found my number.</p>
<p>My next consideration was to think about what numbers wouldn&#8217;t need to be tested if bigger numbers succeeded, e.g anything divisible by 20 would also be divisible by 2 etc&#8230; This led me to a path to stop my calculations when hitting 8 as the counter.</p>
<p>Finally, the for loop didn&#8217;t need to go through all the numbers. It could start at 20, and then increment by 20 every time.</p>
<p>To test any efficiency gains, rather than using the default output from NetBeans I also logged the in milliseconds before starting and upon completion. Interestingly (and I can&#8217;t explain why), I took slightly longer to stop dividing at 8 rather than just continue through checking the lower numbers. When I say slower, only by 1 millisecond or so.</p>
<p>And so my final solution is as below, and takes approximately 70 milliseconds to complete.</p>
<p><pre class="brush: java;">
boolean found = false;
int sum = 0;

for (int i = 20; !found; i = i + 20) {
   int starting = 19;
   boolean breakOut = false;

   while (!found &amp;&amp; !breakOut) {
      if ((i % starting) == 0) {
         starting--;

         if (starting == 0) {
            sum = i;
            found = true;
         }
      } else {
         breakOut = true;
      }
   }
}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gregorbowie.wordpress.com/478/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gregorbowie.wordpress.com/478/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gregorbowie.wordpress.com/478/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gregorbowie.wordpress.com/478/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gregorbowie.wordpress.com/478/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gregorbowie.wordpress.com/478/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gregorbowie.wordpress.com/478/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gregorbowie.wordpress.com/478/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gregorbowie.wordpress.com/478/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gregorbowie.wordpress.com/478/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gregorbowie.wordpress.com/478/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gregorbowie.wordpress.com/478/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gregorbowie.wordpress.com/478/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gregorbowie.wordpress.com/478/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregorbowie.wordpress.com&amp;blog=9294073&amp;post=478&amp;subd=gregorbowie&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gregorbowie.wordpress.com/2012/01/27/euler-problem-5-weekly-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b3f77639282f85e21238262b121c83b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gregorbowie</media:title>
		</media:content>
	</item>
		<item>
		<title>Euler Problem 8</title>
		<link>http://gregorbowie.wordpress.com/2012/01/20/euler-problem-8/</link>
		<comments>http://gregorbowie.wordpress.com/2012/01/20/euler-problem-8/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 15:00:36 +0000</pubDate>
		<dc:creator>gregorbowie</dc:creator>
				<category><![CDATA[Euler Problems]]></category>

		<guid isPermaLink="false">http://gregorbowie.wordpress.com/?p=476</guid>
		<description><![CDATA[So continuing the dual solving of problems with Anthony Doherty, he decided to choose Problem 8 for this week. Again, I didn&#8217;t think the following solution would be very quick or efficient, but decided to go with the coding principle of make it work, make it pretty, make it fast. Java though completed the task [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregorbowie.wordpress.com&amp;blog=9294073&amp;post=476&amp;subd=gregorbowie&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So continuing the dual solving of problems with Anthony Doherty, he decided to choose Problem 8 for this week.</p>
<p>Again, I didn&#8217;t think the following solution would be very quick or efficient, but decided to go with the coding principle of make it work, make it pretty, make it fast. Java though completed the task in approximately 0 seconds according to NetBeans, so I was able to skip the make it fast step for the time being.</p>
<p>Update: Whilst typing out this post a slightly more efficient way to do things would be to only read in the next number from the string and overwrite the oldest &#8211; some kind of LIFO queue or list. It wouldn&#8217;t be difficult to implement, but having been out of the office yesterday, think I need to divert my attention elsewhere for a while.</p>
<p>Solution:</p>
<p><pre class="brush: java;">
        int index = 5;
        int max = 0;

        for (int i = 0; i &lt; inputNumber.length() - index; i++) {
             String sub = inputNumber.substring(i, i + index);
             int j = Integer.parseInt(sub.substring(0, 1));
             int k = Integer.parseInt(sub.substring(1, 2));
             int l = Integer.parseInt(sub.substring(2, 3));
             int m = Integer.parseInt(sub.substring(3, 4));
             int n = Integer.parseInt(sub.substring(4, 5));
             int sum = j * k * l * m * n;

             if (sum &gt; max) {
                max = sum;
             }
        }

     System.out.println(&quot;Max = &quot; + max);
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gregorbowie.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gregorbowie.wordpress.com/476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gregorbowie.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gregorbowie.wordpress.com/476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gregorbowie.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gregorbowie.wordpress.com/476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gregorbowie.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gregorbowie.wordpress.com/476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gregorbowie.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gregorbowie.wordpress.com/476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gregorbowie.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gregorbowie.wordpress.com/476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gregorbowie.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gregorbowie.wordpress.com/476/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregorbowie.wordpress.com&amp;blog=9294073&amp;post=476&amp;subd=gregorbowie&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gregorbowie.wordpress.com/2012/01/20/euler-problem-8/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b3f77639282f85e21238262b121c83b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gregorbowie</media:title>
		</media:content>
	</item>
		<item>
		<title>Euler Problem 4</title>
		<link>http://gregorbowie.wordpress.com/2012/01/13/euler-problem-4/</link>
		<comments>http://gregorbowie.wordpress.com/2012/01/13/euler-problem-4/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 15:00:51 +0000</pubDate>
		<dc:creator>gregorbowie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://gregorbowie.wordpress.com/?p=472</guid>
		<description><![CDATA[So continuing with the series of solving Euler presented problems, this shows Problem 4. Interesting I&#8217;ve teamed up with a former colleague on Twitter, @am_doherty, we&#8217;ve decided to tackle 1 a week. We&#8217;ll both post our solutions on a Friday, at about 3pm. It&#8217;ll be interesting to see different solutions that we come up with. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregorbowie.wordpress.com&amp;blog=9294073&amp;post=472&amp;subd=gregorbowie&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So continuing with the series of solving Euler presented problems, this shows Problem 4. Interesting I&#8217;ve teamed up with a former colleague on Twitter, <a href="https://twitter.com/#!/AM_Doherty" target="_blank">@am_doherty</a>, we&#8217;ve decided to tackle 1 a week. We&#8217;ll both post our solutions on a Friday, at about 3pm. It&#8217;ll be interesting to see different solutions that we come up with.</p>
<p>I chose Problem 4 this week, @am_doherty will choose the problem next week.</p>
<p><strong>Euler Problem 4</strong></p>
<div>
<p>A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 <img src="http://projecteuler.net/images/symbol_times.gif" alt="×" width="9" height="9" border="0" /> 99.</p>
<p>Find the largest palindrome made from the product of two 3-digit numbers.</p>
<p><strong>My Solution</strong></p>
<p>At first I thought this solution would be incredibly slow, but after running it, it completes in less than a second and so seems good enough.</p>
<p>The main method is as follows:</p>
<p><pre class="brush: java;">
int max = 0;
int param1 = 0;
int param2 = 0;
int jMin = 99;

for (int i = 999; i &amp;gt; 99; i--) {
  for (int j = 999; j &amp;gt; jMin; j--) {
    String result = Integer.toString(i * j);
    String reversed = reverseStr(result);

    if (result.equals(reversed)) {
      if (i * j &amp;gt; max) {
        param1 = i;
        param2 = j;
        jMin = j;
        max = i * j;
        break;
      }
    }
  }
}

System.out.println(&quot;param1 = &quot; + param1 + &quot;, param2 = &quot; + param2 + &quot;, max = &quot; + max);
</pre></p>
<p>I added in a few extra parameters to reduce the loop mechanism and whilst I think these made the program a little faster, the program still executed in under a second without them.</p>
<p>The reverseStr method is as follows. I&#8217;m certain there may be a faster way of doing this, but with the small strings involved it seemed good enough:</p>
<p><pre class="brush: java;">
public static String reverseStr(String orgStr) {
  StringBuilder reverseStr = new StringBuilder();
  for (int i = orgStr.length(); i &amp;gt; 0; i--) {
    reverseStr.append(orgStr.charAt(i - 1));
  }

  return reverseStr.toString();
}
</pre></p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gregorbowie.wordpress.com/472/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gregorbowie.wordpress.com/472/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gregorbowie.wordpress.com/472/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gregorbowie.wordpress.com/472/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gregorbowie.wordpress.com/472/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gregorbowie.wordpress.com/472/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gregorbowie.wordpress.com/472/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gregorbowie.wordpress.com/472/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gregorbowie.wordpress.com/472/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gregorbowie.wordpress.com/472/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gregorbowie.wordpress.com/472/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gregorbowie.wordpress.com/472/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gregorbowie.wordpress.com/472/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gregorbowie.wordpress.com/472/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregorbowie.wordpress.com&amp;blog=9294073&amp;post=472&amp;subd=gregorbowie&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gregorbowie.wordpress.com/2012/01/13/euler-problem-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b3f77639282f85e21238262b121c83b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gregorbowie</media:title>
		</media:content>

		<media:content url="http://projecteuler.net/images/symbol_times.gif" medium="image">
			<media:title type="html">×</media:title>
		</media:content>
	</item>
		<item>
		<title>Euler Problem 3</title>
		<link>http://gregorbowie.wordpress.com/2012/01/10/euler-problem-3/</link>
		<comments>http://gregorbowie.wordpress.com/2012/01/10/euler-problem-3/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 12:28:57 +0000</pubDate>
		<dc:creator>gregorbowie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://gregorbowie.wordpress.com/2012/01/10/euler-problem-3/</guid>
		<description><![CDATA[This was the 1st problem that caused me a little bit of thinking time, and hence the idea to blog. Euler Problem 3 The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ? Solution / Thoughts My 1st thought which I knew would [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregorbowie.wordpress.com&amp;blog=9294073&amp;post=471&amp;subd=gregorbowie&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This was the 1st problem that caused me a little bit of thinking time, and hence the idea to blog.</p>
<p><a href="http://projecteuler.net/problem=3" target="_blank">Euler Problem 3</a></p>
<p>The prime factors of 13195 are 5, 7, 13 and 29.</p>
<p>What is the largest prime factor of the number 600851475143 ?</p>
<p><strong>Solution / Thoughts</strong></p>
<p>My 1st thought which I knew would clearly take far too long was to loop from i = 3 to 600851475143. This posed 2 problems &#8211; (a) looping for that long would take forever, and also (b) the largest prime factor was likely to be found long before the large number involved. Another thought was to loop backwards, but again this wouldn&#8217;t overcome reason (b).</p>
<p>The loop was speeded up slightly by incrementing by 2 rather than the traditional 1 in a for&#8230;loop, but that really didn&#8217;t do anything to overcome the problems already identified.</p>
<p>My way of solving it still relied on the loop thought, but worked with the idea of finding the correlating value for the earlier successful divisions. So my final implementation was:</p>
<p>        long number = 600851475143L;<br />        <br />        for (long i = 3; i &lt; number; i = i + 2) {<br />            if ((number % i) == 0) {<br />                long temp = number / i;<br />                if (isPrime(temp)) {<br />                    System.out.println(temp);<br />                    break;<br />                }<br />            }<br />        }</p>
<p>* There are plenty of isPrime() sample methods available on the Internet.</p>
<p>Answer: 6857</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gregorbowie.wordpress.com/471/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gregorbowie.wordpress.com/471/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gregorbowie.wordpress.com/471/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gregorbowie.wordpress.com/471/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gregorbowie.wordpress.com/471/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gregorbowie.wordpress.com/471/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gregorbowie.wordpress.com/471/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gregorbowie.wordpress.com/471/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gregorbowie.wordpress.com/471/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gregorbowie.wordpress.com/471/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gregorbowie.wordpress.com/471/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gregorbowie.wordpress.com/471/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gregorbowie.wordpress.com/471/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gregorbowie.wordpress.com/471/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregorbowie.wordpress.com&amp;blog=9294073&amp;post=471&amp;subd=gregorbowie&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gregorbowie.wordpress.com/2012/01/10/euler-problem-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b3f77639282f85e21238262b121c83b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gregorbowie</media:title>
		</media:content>
	</item>
		<item>
		<title>Euler Problem 2</title>
		<link>http://gregorbowie.wordpress.com/2012/01/10/euler-problem-2/</link>
		<comments>http://gregorbowie.wordpress.com/2012/01/10/euler-problem-2/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 12:18:31 +0000</pubDate>
		<dc:creator>gregorbowie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://gregorbowie.wordpress.com/2012/01/10/euler-problem-2/</guid>
		<description><![CDATA[This one was incredibly straight forward again, so no real need to comment. Solution is provided below for any corrections or observations&#8230; Euler Problem 2 Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1, 2, 3, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregorbowie.wordpress.com&amp;blog=9294073&amp;post=447&amp;subd=gregorbowie&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This one was incredibly straight forward again, so no real need to comment. Solution is provided below for any corrections or observations&#8230;</p>
<p><a href="http://projecteuler.net/problem=2" target="_blank">Euler Problem 2</a></p>
<p>Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:</p>
<p>1, 2, 3, 5, 8, 13, 21, 34, 55, 89, &#8230;</p>
<p>By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.</p>
<p><strong>Solution</strong></p>
<p>int prev = 1;<br />        int now = 2;<br />        int temp = 0;<br />        int total = 0;<br />        <br />        while (prev &lt; 4000000) {<br />            if ((now % 2) == 0) {<br />                total += now;<br />            }<br />            <br />            temp = now + prev;<br />            prev = now;<br />            now = temp;<br />        }<br />        <br />        System.out.println(&#8220;Total: &#8221; + total);</p>
<p>Answer: <strong>4613732</strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gregorbowie.wordpress.com/447/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gregorbowie.wordpress.com/447/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gregorbowie.wordpress.com/447/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gregorbowie.wordpress.com/447/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gregorbowie.wordpress.com/447/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gregorbowie.wordpress.com/447/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gregorbowie.wordpress.com/447/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gregorbowie.wordpress.com/447/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gregorbowie.wordpress.com/447/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gregorbowie.wordpress.com/447/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gregorbowie.wordpress.com/447/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gregorbowie.wordpress.com/447/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gregorbowie.wordpress.com/447/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gregorbowie.wordpress.com/447/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregorbowie.wordpress.com&amp;blog=9294073&amp;post=447&amp;subd=gregorbowie&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gregorbowie.wordpress.com/2012/01/10/euler-problem-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b3f77639282f85e21238262b121c83b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gregorbowie</media:title>
		</media:content>
	</item>
		<item>
		<title>Euler Programming &#8211; Problem 1</title>
		<link>http://gregorbowie.wordpress.com/2012/01/10/euler-programming-problem-1/</link>
		<comments>http://gregorbowie.wordpress.com/2012/01/10/euler-programming-problem-1/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 12:05:01 +0000</pubDate>
		<dc:creator>gregorbowie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://gregorbowie.wordpress.com/2012/01/10/euler-programming-problem-1/</guid>
		<description><![CDATA[Ok, so running blogging took over from technical blogging. Something I&#8217;m going to attempt to rectify this year (a number of small steps to improve myself over the coming year hopefully). Scanning through my Twitter stream over the Christmas break I came across an article about Euler Programming site, which provides puzzles to be solved. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregorbowie.wordpress.com&amp;blog=9294073&amp;post=439&amp;subd=gregorbowie&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Ok, so running blogging took over from technical blogging. Something I&#8217;m going to attempt to rectify this year (a number of small steps to improve myself over the coming year hopefully).</p>
<p>Scanning through my Twitter stream over the Christmas break I came across an article about <a href="http://projecteuler.net" target="_blank">Euler Programming</a> site, which provides puzzles to be solved. I&#8217;ve decided to start doing these, attempting to do at least 1 a day to try and re-activate my mind. The 1-a-day routine isn&#8217;t really succeeding at this stage though &#8211; I&#8217;ve just solved Problem 3, and this is the 10th day of January. Ah well.</p>
<p>I&#8217;ll attempt to post my solution to each problem, in the hope that if I&#8217;ve gone wrong, or there is a better way someone might point me in the right direction. All solutions will be done in Java.</p>
<p><strong><a href="http://projecteuler.net/problem=1" target="_blank">Euler Problem 1</a></strong></p>
<div>
<p>If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.</p>
<p>Find the sum of all the multiples of 3 or 5 below 1000.</p>
<p><strong>My Answer</strong></p>
<p>        int sum = 0;<br />        <br />        for (int i = 1; i &lt; 1000; i++) {<br />            if (((i % 3) == 0) || ((i % 5) == 0)) {<br />                sum += i;<br />            }<br />        }<br />        <br />        System.out.println(&#8220;Sum: &#8221; + sum);</p>
<p>And the overall answer is: 233168</p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gregorbowie.wordpress.com/439/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gregorbowie.wordpress.com/439/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gregorbowie.wordpress.com/439/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gregorbowie.wordpress.com/439/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gregorbowie.wordpress.com/439/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gregorbowie.wordpress.com/439/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gregorbowie.wordpress.com/439/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gregorbowie.wordpress.com/439/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gregorbowie.wordpress.com/439/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gregorbowie.wordpress.com/439/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gregorbowie.wordpress.com/439/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gregorbowie.wordpress.com/439/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gregorbowie.wordpress.com/439/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gregorbowie.wordpress.com/439/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregorbowie.wordpress.com&amp;blog=9294073&amp;post=439&amp;subd=gregorbowie&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gregorbowie.wordpress.com/2012/01/10/euler-programming-problem-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b3f77639282f85e21238262b121c83b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gregorbowie</media:title>
		</media:content>
	</item>
		<item>
		<title>GlassFish / Oracle RAC / java.sql.SQLRecoverableException: Closed Connection</title>
		<link>http://gregorbowie.wordpress.com/2011/12/08/glassfish-oracle-rac-java-sql-sqlrecoverableexception-closed-connection/</link>
		<comments>http://gregorbowie.wordpress.com/2011/12/08/glassfish-oracle-rac-java-sql-sqlrecoverableexception-closed-connection/#comments</comments>
		<pubDate>Thu, 08 Dec 2011 14:07:53 +0000</pubDate>
		<dc:creator>gregorbowie</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://gregorbowie.wordpress.com/?p=412</guid>
		<description><![CDATA[For a period of time we&#8217;ve been having issues with failover of Oracle RAC for an application sitting on GlassFish. After considering various solutions, we&#8217;re currently monitor one implementation that appears to have promising indications at the moment for being a permanent solution (although perhaps a little early to be certain). The solution appears to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregorbowie.wordpress.com&amp;blog=9294073&amp;post=412&amp;subd=gregorbowie&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For a period of time we&#8217;ve been having issues with failover of Oracle RAC for an application sitting on GlassFish.</p>
<p>After considering various solutions, we&#8217;re currently monitor one implementation that appears to have promising indications at the moment for being a permanent solution (although perhaps a little early to be certain).</p>
<p>The solution appears to be to use the &#8216;Connection Validation&#8217; properties under the Advanced Tab. We&#8217;re currently enabled to perform a select before the actual query attempted to run (and we&#8217;ve nominated the DUAL table for the select to be carried out on). If this fails, then that connection is dropped from the pool, and the next available connection is sourced. If all available connections fail, then fresh connections are made within the pool.</p>
<p>There appears to be an omission for RAC failover support in the Oracle-Thin library, hence the requirement for using this setting.</p>
<p>Further reading:</p>
<p><a href="http://alexandru-ersenie.com/tag/glassfish/" target="_blank">http://alexandru-ersenie.com/tag/glassfish/</a><br />
<a href="http://old.nabble.com/how-do-I-avoid-a-connection-pool-filling-up--td21432580.html" target="_blank">http://old.nabble.com/how-do-I-avoid-a-connection-pool-filling-up&#8211;td21432580.html</p>
<p>http://docs.oracle.com/cd/E18930_01/html/821-2431/abehp.html</a></p>
<p><a href="http://old.nabble.com/how-do-I-avoid-a-connection-pool-filling-up--td21432580.html" target="_blank"><br />
</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gregorbowie.wordpress.com/412/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gregorbowie.wordpress.com/412/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gregorbowie.wordpress.com/412/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gregorbowie.wordpress.com/412/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gregorbowie.wordpress.com/412/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gregorbowie.wordpress.com/412/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gregorbowie.wordpress.com/412/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gregorbowie.wordpress.com/412/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gregorbowie.wordpress.com/412/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gregorbowie.wordpress.com/412/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gregorbowie.wordpress.com/412/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gregorbowie.wordpress.com/412/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gregorbowie.wordpress.com/412/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gregorbowie.wordpress.com/412/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregorbowie.wordpress.com&amp;blog=9294073&amp;post=412&amp;subd=gregorbowie&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gregorbowie.wordpress.com/2011/12/08/glassfish-oracle-rac-java-sql-sqlrecoverableexception-closed-connection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b3f77639282f85e21238262b121c83b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gregorbowie</media:title>
		</media:content>
	</item>
		<item>
		<title>ORA-24816: Expanded non LONG bind data supplied after actual LONG or LOB column</title>
		<link>http://gregorbowie.wordpress.com/2011/11/15/ora-24816-expanded-non-long-bind-data-supplied-after-actual-long-or-lob-column/</link>
		<comments>http://gregorbowie.wordpress.com/2011/11/15/ora-24816-expanded-non-long-bind-data-supplied-after-actual-long-or-lob-column/#comments</comments>
		<pubDate>Tue, 15 Nov 2011 14:17:30 +0000</pubDate>
		<dc:creator>gregorbowie</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JPA]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://gregorbowie.wordpress.com/?p=406</guid>
		<description><![CDATA[There has been a bit of an on-going saga with this error message appearing from time to time in a live production environment. Today was the day that a real investigation was required to get to the root of the issue. From some reading around it turns out having a mixture of CLOBs and varchar2(4000) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregorbowie.wordpress.com&amp;blog=9294073&amp;post=406&amp;subd=gregorbowie&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There has been a bit of an on-going saga with this error message appearing from time to time in a live production environment. Today was the day that a real investigation was required to get to the root of the issue.</p>
<p>From some reading around it turns out having a mixture of CLOBs and varchar2(4000) fields in a database causes some issues for Oracle, especially during an insert. To overcome this the CLOB(s) must be the last parameters inserted in the SQL statement.</p>
<p>Unfortunately we use TopLink/JPA and so aren&#8217;t in control of our query structure.</p>
<p><strong>Solution 1</strong></p>
<p>Alter all varchar2(4000) to be CLOBs. In order to do this you&#8217;d need to run the following queries:</p>
<div><pre class="brush: sql;">
alter table &lt;table&gt; add &lt;field&gt;_copy varchar2(4000)
update &lt;table&gt; set &lt;field&gt;_copy = &lt;field&gt;
update &lt;table&gt; set &lt;field&gt; = null
commit&lt;/div&gt;
alter table &lt;table&gt; modify &lt;field&gt; long
alter table &lt;table&gt; modify &lt;field&gt; clob
update &lt;table&gt; set &lt;field&gt; = &lt;field&gt;_copy
alter table &lt;table&gt; drop column &lt;field&gt;_copy
commit
</pre></p>
</div>
<p>After doing this I encountered an issue with the index link to this table not being correct. To resolve this issue:</p>
<p><pre class="brush: sql;">
alter index &lt;index&gt; rebuild
</pre></p>
<p><strong>Solution 2</strong></p>
<p>Run the query as normal and omit the setting of the CLOB(s) field.<br />
After persisting the original query, lookup the bean and update the CLOBs fields before persisting again.</p>
<p><strong>References</strong></p>
<p><a href="http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1770086700346491686">Ask Tom &#8211; Change a Column varchar2 to CLOB</a><br />
<a href="http://download.oracle.com/docs/cd/B10501_01/server.920/a96652/ch09.htm#1007759">Indexes Left in an Unstable State</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gregorbowie.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gregorbowie.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gregorbowie.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gregorbowie.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gregorbowie.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gregorbowie.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gregorbowie.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gregorbowie.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gregorbowie.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gregorbowie.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gregorbowie.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gregorbowie.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gregorbowie.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gregorbowie.wordpress.com/406/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregorbowie.wordpress.com&amp;blog=9294073&amp;post=406&amp;subd=gregorbowie&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gregorbowie.wordpress.com/2011/11/15/ora-24816-expanded-non-long-bind-data-supplied-after-actual-long-or-lob-column/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b3f77639282f85e21238262b121c83b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gregorbowie</media:title>
		</media:content>
	</item>
		<item>
		<title>Java Message Queuing (Continued)</title>
		<link>http://gregorbowie.wordpress.com/2011/08/18/java-message-queuing-continued/</link>
		<comments>http://gregorbowie.wordpress.com/2011/08/18/java-message-queuing-continued/#comments</comments>
		<pubDate>Thu, 18 Aug 2011 08:38:41 +0000</pubDate>
		<dc:creator>gregorbowie</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JMS]]></category>

		<guid isPermaLink="false">https://gregorbowie.wordpress.com/?p=401</guid>
		<description><![CDATA[Regular readers of this blog will know I’ve struggled with Java and Message Queuing (see blog posts here, here, here and here). Normally by this point I would have given up, but having used Message Queuing to integrate a number of systems in a Microsoft world I really understand and appreciate the power of them [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregorbowie.wordpress.com&amp;blog=9294073&amp;post=401&amp;subd=gregorbowie&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Regular readers of this blog will know I’ve struggled with Java and Message Queuing (see blog posts <a href="http://gregorbowie.wordpress.com/2010/11/08/jms-handling-an-error/">here</a>, <a href="http://gregorbowie.wordpress.com/2010/11/04/java-messaging-system-sending-to-local-glassfish-v3/" target="_blank">here</a>, <a href="http://gregorbowie.wordpress.com/2010/09/29/messaging-queue-handling-errors/" target="_blank">here</a> and <a href="http://gregorbowie.wordpress.com/2010/09/28/java-messaging-queuing-jms/" target="_blank">here</a>). Normally by this point I would have given up, but having used Message Queuing to integrate a number of systems in a Microsoft world I really understand and appreciate the power of them when done properly.</p>
<p>So yesterday I returned to the issue. Having listened to <a href="http://thisdeveloperslife.com/" target="_blank">This Developers Life</a> podcast about the downtime at <a href="http://stackoverflow.com/" target="_blank">StackOverflow</a> I decided StackOverflow was a resource I was aware of, but had never really used (other than via the occasional Google result). I searched StackOverflow for information on Java Message Queuing, and go directed towards <a href="http://mq.java.net/" target="_blank">OpenMQ</a>.</p>
<p>Heading back to Google I found a couple of useful articles about using OpenMQ and from the contents of both managed to get myself sending messages to a local GlassFish instance. However, I’m fairly certain I’d be able to alter this code slightly to send to a remote machine – just something I don’t currently have the capabilities (or the pressing need) to confirm.</p>
<p>As per most of my posts, this is primarily for my own reference when I need to return to it at some point in the future – but it may prove of use to others.</p>
<p>The two resources of particular use were: <a href="http://kalali.me/openmq-the-open-source-message-queuing-for-beginners-and-professionals-openmq-from-a-to-z/">http://kalali.me/openmq-the-open-source-message-queuing-for-beginners-and-professionals-openmq-from-a-to-z/</a> and <a href="http://mq.java.net/mqmonitor/mqmonitor.html">http://mq.java.net/mqmonitor/mqmonitor.html</a></p>
<p>The actual code that worked for sending a message for me was:</p>
<p><pre class="brush: java;">
public static void main(String[] args) throws JMSException {
   com.sun.messaging.ConnectionFactory connectionFactory = new com.sun.messaging.ConnectionFactory();
   connectionFactory.setProperty(com.sun.messaging.ConnectionConfiguration.imqAddressList,
                                 &quot;mq://127.0.0.1:7676&quot;);
   javax.jms.QueueConnection queueConnection = connectionFactory.createQueueConnection(&quot;xxx&quot;, &quot;xxx&quot;);
   javax.jms.QueueSession queueSession = queueConnection.createQueueSession(false,
                                 Session.AUTO_ACKNOWLEDGE);
   javax.jms.Queue smsQueue = queueSession.createQueue(&quot;gbTestQueue&quot;);
   javax.jms.MessageProducer producer = queueSession.createSender(smsQueue);
   Message msg = queueSession.createTextMessage(&quot;A sample sms message&quot;);
   producer.send(msg);
}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gregorbowie.wordpress.com/401/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gregorbowie.wordpress.com/401/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gregorbowie.wordpress.com/401/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gregorbowie.wordpress.com/401/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gregorbowie.wordpress.com/401/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gregorbowie.wordpress.com/401/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gregorbowie.wordpress.com/401/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gregorbowie.wordpress.com/401/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gregorbowie.wordpress.com/401/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gregorbowie.wordpress.com/401/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gregorbowie.wordpress.com/401/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gregorbowie.wordpress.com/401/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gregorbowie.wordpress.com/401/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gregorbowie.wordpress.com/401/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregorbowie.wordpress.com&amp;blog=9294073&amp;post=401&amp;subd=gregorbowie&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gregorbowie.wordpress.com/2011/08/18/java-message-queuing-continued/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b3f77639282f85e21238262b121c83b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gregorbowie</media:title>
		</media:content>
	</item>
		<item>
		<title>Selenium</title>
		<link>http://gregorbowie.wordpress.com/2011/06/29/selenium/</link>
		<comments>http://gregorbowie.wordpress.com/2011/06/29/selenium/#comments</comments>
		<pubDate>Wed, 29 Jun 2011 12:14:38 +0000</pubDate>
		<dc:creator>gregorbowie</dc:creator>
				<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">https://gregorbowie.wordpress.com/2011/06/29/selenium/</guid>
		<description><![CDATA[After years of reading about Selenium I actually got sometime today to play with it in anger. I think I’ve been scared off automated GUI testing for quite a while after getting my hands stung when automated some GUI tests some years back, only for the front-end to have a complete revamp and nothing work [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregorbowie.wordpress.com&amp;blog=9294073&amp;post=398&amp;subd=gregorbowie&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>After years of reading about Selenium I actually got sometime today to play with it in anger. I think I’ve been scared off automated GUI testing for quite a while after getting my hands stung when automated some GUI tests some years back, only for the front-end to have a complete revamp and nothing work (I think the principle being used at the time was pixel locations).</p>
<p>So after overcoming my fears, I needed to quickly see if I could generate some data for testing. We repeat this numerous times at work when nearing a release date and it becomes quite an arduous and time consuming process. The longest and hardest part of getting Selenium going was downloading the Firefox plugin and trying to figure out why it wasn’t running it automatically, before remembering I’ve recently switched to using Google Chrome as my default browser.</p>
<p>2 minutes later I had my first test script running and creating the data I was after, adding in the various tests along the way to indicate everything was going as expected.</p>
<p>Whilst this is fine, the bit I’m really looking forward to experimenting with the language export stuff to Selenium RC. This really will open some doors at work and hopefully really speed up some time consuming processes. I’m hoping we can take it a stage further by putting a GUI on the front to specify some of the values we’re interested in using.</p>
<p>So much like <a href="http://gregorbowie.wordpress.com/2010/11/25/jmeter-load-testing-a-website/" target="_blank">JMeter a few months ago</a>, I really do need to start investigating more of these tools that I hear about from various day-to-day reading materials. They really will free up time in the long run.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gregorbowie.wordpress.com/398/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gregorbowie.wordpress.com/398/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gregorbowie.wordpress.com/398/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gregorbowie.wordpress.com/398/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gregorbowie.wordpress.com/398/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gregorbowie.wordpress.com/398/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gregorbowie.wordpress.com/398/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gregorbowie.wordpress.com/398/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gregorbowie.wordpress.com/398/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gregorbowie.wordpress.com/398/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gregorbowie.wordpress.com/398/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gregorbowie.wordpress.com/398/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gregorbowie.wordpress.com/398/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gregorbowie.wordpress.com/398/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gregorbowie.wordpress.com&amp;blog=9294073&amp;post=398&amp;subd=gregorbowie&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gregorbowie.wordpress.com/2011/06/29/selenium/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b3f77639282f85e21238262b121c83b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gregorbowie</media:title>
		</media:content>
	</item>
	</channel>
</rss>
