<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>code and effect</title>
	<atom:link href="http://codeandeffect.co.uk/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://codeandeffect.co.uk/blog</link>
	<description>@AM_Doherty</description>
	<lastBuildDate>Mon, 20 Feb 2012 14:20:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>February self-portraits &#8211; assemblages, landscapes, graphic work and sketchbooks</title>
		<link>http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/february-self-portraits-assemblages-landscapes-graphic-work-and-sketchbooks/</link>
		<comments>http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/february-self-portraits-assemblages-landscapes-graphic-work-and-sketchbooks/#comments</comments>
		<pubDate>Mon, 20 Feb 2012 14:20:46 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[One self-portrait a day 2012]]></category>

		<guid isPermaLink="false">http://codeandeffect.co.uk/blog/?p=1240</guid>
		<description><![CDATA[February&#8217;s had some contrasts. The month began positively with a personal assemblage work and a graphic derivation of it, which I hoped would shake things up a bit. Since then I&#8217;ve returned largely to mirror work of questionable quality. So &#8230; <a href="http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/february-self-portraits-assemblages-landscapes-graphic-work-and-sketchbooks/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>February&#8217;s had some contrasts.</p>
<p>The month began positively with a <a title="Moo-cough" href="/blog/2012/one-self-portrait-a-day-2012/moo-cough/">personal assemblage work</a> and a graphic derivation of it, which I hoped would shake things up a bit. Since then I&#8217;ve returned largely to mirror work of questionable quality.</p>
<p>So far this month there&#8217;s pencil, ink, pastel, impressed cardboard(5th), gouache(10th) and charcoal(13,14th) and frequent shifting of scale &#8211; from sheets of cartridge down to notebooks, sketchbooks and paper bags(8th).</p>

<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/moo-cough/attachment/day032/' title='February 1st'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/02/day032-150x150.jpg" class="attachment-thumbnail" alt="February 1st" title="February 1st" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/day-33-moo-cough-and-i/attachment/day033a/' title='February 2nd'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/02/day033a-150x150.png" class="attachment-thumbnail" alt="February 2nd" title="February 2nd" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/february-self-portraits-assemblages-landscapes-graphic-work-and-sketchbooks/attachment/day034/' title='February 3rd'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/02/day034-150x150.jpg" class="attachment-thumbnail" alt="February 3rd" title="February 3rd" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/february-self-portraits-assemblages-landscapes-graphic-work-and-sketchbooks/attachment/day035/' title='February 4th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/02/day035-150x150.jpg" class="attachment-thumbnail" alt="February 4th" title="February 4th" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/february-self-portraits-assemblages-landscapes-graphic-work-and-sketchbooks/attachment/day036/' title='February 5th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/02/day036-150x150.jpg" class="attachment-thumbnail" alt="February 5th" title="February 5th" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/february-self-portraits-assemblages-landscapes-graphic-work-and-sketchbooks/attachment/day037/' title='February 6th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/02/day037-150x150.jpg" class="attachment-thumbnail" alt="February 6th" title="February 6th" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/february-self-portraits-assemblages-landscapes-graphic-work-and-sketchbooks/attachment/day038/' title='February 7th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/02/day038-150x150.jpg" class="attachment-thumbnail" alt="February 7th" title="February 7th" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/february-self-portraits-assemblages-landscapes-graphic-work-and-sketchbooks/attachment/day039b/' title='February 8th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/02/day039b-150x150.jpg" class="attachment-thumbnail" alt="February 8th" title="February 8th" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/february-self-portraits-assemblages-landscapes-graphic-work-and-sketchbooks/attachment/day040/' title='February 9th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/02/day040-150x150.jpg" class="attachment-thumbnail" alt="February 9th" title="February 9th" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/february-self-portraits-assemblages-landscapes-graphic-work-and-sketchbooks/attachment/day042/' title='February 11th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/02/day042-150x150.jpg" class="attachment-thumbnail" alt="February 11th" title="February 11th" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/february-self-portraits-assemblages-landscapes-graphic-work-and-sketchbooks/attachment/day041/' title='February 10th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/02/day041-150x150.jpg" class="attachment-thumbnail" alt="February 10th" title="February 10th" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/february-self-portraits-assemblages-landscapes-graphic-work-and-sketchbooks/attachment/day043/' title='February 12th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/02/day043-150x150.jpg" class="attachment-thumbnail" alt="February 12th" title="February 12th" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/february-self-portraits-assemblages-landscapes-graphic-work-and-sketchbooks/attachment/day044/' title='February 13th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/02/day044-150x150.jpg" class="attachment-thumbnail" alt="February 13th" title="February 13th" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/february-self-portraits-assemblages-landscapes-graphic-work-and-sketchbooks/attachment/day045/' title='February 14th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/02/day045-150x150.jpg" class="attachment-thumbnail" alt="February 14th" title="February 14th" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/february-self-portraits-assemblages-landscapes-graphic-work-and-sketchbooks/attachment/day046/' title='February 15th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/02/day046-150x150.jpg" class="attachment-thumbnail" alt="February 16th" title="February 15th" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/february-self-portraits-assemblages-landscapes-graphic-work-and-sketchbooks/attachment/day047/' title='February 16th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/02/day047-150x150.jpg" class="attachment-thumbnail" alt="February 16th" title="February 16th" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/february-self-portraits-assemblages-landscapes-graphic-work-and-sketchbooks/attachment/day048/' title='February 17th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/02/day048-150x150.jpg" class="attachment-thumbnail" alt="February 17th" title="February 17th" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/february-self-portraits-assemblages-landscapes-graphic-work-and-sketchbooks/attachment/day049/' title='February 18th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/02/day049-150x150.jpg" class="attachment-thumbnail" alt="February 18th" title="February 18th" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/february-self-portraits-assemblages-landscapes-graphic-work-and-sketchbooks/attachment/day050/' title='February 19th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/02/day050-150x150.jpg" class="attachment-thumbnail" alt="February 19th" title="February 19th" /></a>

<p>For the non-visually-representative work the subject matter is becoming more personal, so finally there&#8217;s a landscape(15th) without figures. I thought I&#8217;d have found that route far earlier. </p>
<p>February 16th saw me correcting the prior composition and setting to match the particulars of the subject that&#8217;s been in mind for some time &#8211; I think there&#8217;s a painting coming together.</p>
]]></content:encoded>
			<wfw:commentRss>http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/february-self-portraits-assemblages-landscapes-graphic-work-and-sketchbooks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<enclosure url="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/02/day0321-150x150.jpg" length="4520" type="image/jpg" />	</item>
		<item>
		<title>Euler Problem 10</title>
		<link>http://codeandeffect.co.uk/blog/2012/euler-problems/euler-problem-10/</link>
		<comments>http://codeandeffect.co.uk/blog/2012/euler-problems/euler-problem-10/#comments</comments>
		<pubDate>Fri, 03 Feb 2012 15:01:36 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Euler Problems]]></category>

		<guid isPermaLink="false">http://codeandeffect.co.uk/blog/?p=1214</guid>
		<description><![CDATA[Find the sum of all the primes below two million I&#8217;d say this is the first of the problems Greg and I have tackled that would really benefit from the kind of optimisations we&#8217;ve both added to our previous solutions. &#8230; <a href="http://codeandeffect.co.uk/blog/2012/euler-problems/euler-problem-10/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<blockquote><p>Find the sum of all the primes below two million</p></blockquote>
<p>I&#8217;d say this is the first of the problems Greg and I have tackled that would really benefit from the kind of optimisations we&#8217;ve both added to our previous solutions. The Ruby solution below would take <em>an age</em> to complete:</p>
<div class="codecolorer-container ruby geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">range &nbsp;= <span style="color:#006666;">1999999</span><br />
sumofprimesbelowrange = <span style="color:#006666;">2</span><br />
<span style="color:#9966CC; font-weight:bold;">def</span> isPrime<span style="color:#006600; font-weight:bold;">&#40;</span>num<span style="color:#006600; font-weight:bold;">&#41;</span> &nbsp;<br />
&nbsp; i = <span style="color:#006666;">2</span><br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">while</span> i<span style="color:#006600; font-weight:bold;">&lt;</span>num <br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">if</span> num<span style="color:#006600; font-weight:bold;">%</span>i == <span style="color:#006666;">0</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#0000FF; font-weight:bold;">false</span><br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span> <br />
&nbsp; &nbsp; i=i<span style="color:#006600; font-weight:bold;">+</span><span style="color:#006666;">1</span> &nbsp; <br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span> &nbsp; <br />
<span style="color:#9966CC; font-weight:bold;">end</span> <br />
<span style="color:#9966CC; font-weight:bold;">while</span> range <span style="color:#006600; font-weight:bold;">&gt;</span> <span style="color:#006666;">1</span><br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">if</span> isPrime<span style="color:#006600; font-weight:bold;">&#40;</span>range<span style="color:#006600; font-weight:bold;">&#41;</span> != <span style="color:#0000FF; font-weight:bold;">false</span> <br />
&nbsp; &nbsp; sumofprimesbelowrange=sumofprimesbelowrange<span style="color:#006600; font-weight:bold;">+</span>range<br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
range=range<span style="color:#006600; font-weight:bold;">-</span><span style="color:#006666;">1</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span><br />
<span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Sum of all primes below #{range}&quot;</span><br />
<span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;is #{sumofprimesbelowrange}&quot;</span></div></div>
<p><br/></p>
<h3>improvements</h3>
<p>If a <em>number A</em> (in our range) can be divided to a whole by <em>number B</em>, then it stands that the result of that division will also fail. The next example still takes a long time to return:</p>
<div class="codecolorer-container ruby geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">range &nbsp;= <span style="color:#006666;">2000000</span><br />
counter = <span style="color:#006666;">2</span><br />
sumofprimesbelowrange = <span style="color:#006666;">2</span> <br />
<span style="color:#9966CC; font-weight:bold;">def</span> isPrime<span style="color:#006600; font-weight:bold;">&#40;</span>num<span style="color:#006600; font-weight:bold;">&#41;</span> &nbsp;<br />
&nbsp; i = <span style="color:#006666;">2</span><br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">while</span> <span style="color:#006666;">2</span><span style="color:#006600; font-weight:bold;">*</span>i<span style="color:#006600; font-weight:bold;">&lt;</span>num<br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">if</span> num<span style="color:#006600; font-weight:bold;">%</span>i == <span style="color:#006666;">0</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#0000FF; font-weight:bold;">false</span><br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span> <br />
&nbsp; &nbsp; i=i<span style="color:#006600; font-weight:bold;">+</span><span style="color:#006666;">1</span> &nbsp; <br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span> &nbsp; <br />
<span style="color:#9966CC; font-weight:bold;">end</span> <br />
<span style="color:#9966CC; font-weight:bold;">while</span> counter <span style="color:#006600; font-weight:bold;">&lt;</span> range<br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">if</span> isPrime<span style="color:#006600; font-weight:bold;">&#40;</span>counter<span style="color:#006600; font-weight:bold;">&#41;</span> != <span style="color:#0000FF; font-weight:bold;">false</span> <br />
&nbsp; &nbsp; <span style="color:#CC0066; font-weight:bold;">puts</span> counter <br />
&nbsp; &nbsp; sumofprimesbelowrange=sumofprimesbelowrange<span style="color:#006600; font-weight:bold;">+</span>counter<br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">else</span><br />
&nbsp; &nbsp;<br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
counter=counter<span style="color:#006600; font-weight:bold;">+</span><span style="color:#006666;">1</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span><br />
<span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Sum of all primes below #{counter}&quot;</span><br />
<span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;is #{sumofprimesbelowrange}&quot;</span></div></div>
<p><br/></p>
<h3>Odds</h3>
<p>We also know that the 2 is the only even prime number, so we can ignore all even numbers above 2 completely:</p>
<div class="codecolorer-container ruby geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#9966CC; font-weight:bold;">def</span> isPrime<span style="color:#006600; font-weight:bold;">&#40;</span>num<span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">if</span> num<span style="color:#006600; font-weight:bold;">%</span>2==<span style="color:#006666;">0</span> <br />
&nbsp; <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#0000FF; font-weight:bold;">false</span>;<br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; i = <span style="color:#006666;">2</span><br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">while</span> <span style="color:#006666;">2</span><span style="color:#006600; font-weight:bold;">*</span>i<span style="color:#006600; font-weight:bold;">&lt;</span>num<br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">if</span> num<span style="color:#006600; font-weight:bold;">%</span>i == <span style="color:#006666;">0</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#0000FF; font-weight:bold;">false</span><br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span> <br />
&nbsp; &nbsp; i=i<span style="color:#006600; font-weight:bold;">+</span><span style="color:#006666;">1</span> &nbsp; <br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span> &nbsp; <br />
<span style="color:#9966CC; font-weight:bold;">end</span></div></div>
<p>
After a little reading into primes, the method I&#8217;m using is known as <a href="http://en.wikipedia.org/wiki/Trial_division" target="new">trial division</a>. A further available optimisation allows us to only examine any division up to the square root of the number we&#8217;re checking. So our routine can be amended such:</p>
<div class="codecolorer-container ruby geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#9966CC; font-weight:bold;">def</span> isPrime<span style="color:#006600; font-weight:bold;">&#40;</span>num<span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">if</span> num<span style="color:#006600; font-weight:bold;">%</span>2==<span style="color:#006666;">0</span> <br />
&nbsp; <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#0000FF; font-weight:bold;">false</span>;<br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; i = <span style="color:#006666;">2</span><br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">while</span> i<span style="color:#006600; font-weight:bold;">*</span>i<span style="color:#006600; font-weight:bold;">&lt;</span>=num<br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">if</span> num<span style="color:#006600; font-weight:bold;">%</span>i == <span style="color:#006666;">0</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#0000FF; font-weight:bold;">false</span><br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span> <br />
&nbsp; &nbsp; i=i<span style="color:#006600; font-weight:bold;">+</span><span style="color:#006666;">1</span> &nbsp; <br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span> &nbsp; <br />
<span style="color:#9966CC; font-weight:bold;">end</span></div></div>
<p>
This small change has a big effect, reducing the running time of the script to a matter of a few minutes.</p>
<p>This weeks challenge has been the most interesting yet, I now have lots of additional reading to do on the other possible solutions.</p>
]]></content:encoded>
			<wfw:commentRss>http://codeandeffect.co.uk/blog/2012/euler-problems/euler-problem-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Day 33, Moo-cough and I</title>
		<link>http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/day-33-moo-cough-and-i/</link>
		<comments>http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/day-33-moo-cough-and-i/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 23:55:29 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[One self-portrait a day 2012]]></category>
		<category><![CDATA[Illustrator]]></category>

		<guid isPermaLink="false">http://codeandeffect.co.uk/blog/?p=1195</guid>
		<description><![CDATA[Only in discussion during today did I realise that yesterday&#8217;s ready-made was, when examined with or without prior knowledge of me, probably the most descriptive and personal work so far. I&#8217;m happy that things are taking a turn, I&#8217;d hate &#8230; <a href="http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/day-33-moo-cough-and-i/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div id="attachment_1196" class="wp-caption aligncenter" style="width: 528px"><a href="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/02/day033a.png"><img class=" wp-image-1196 " title="February 2nd" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/02/day033a.png" alt="February 2nd" width="518" height="518" /></a><p class="wp-caption-text">February 2nd</p></div>
<p><a href="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/02/day033b.png"><br />
</a>Only in discussion during today did I realise that <a title="Moo-cough" href="http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/moo-cough/">yesterday&#8217;s ready-made</a> was, when examined with or without prior knowledge of me, probably the most descriptive and personal work so far.</p>
<p><a href="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/02/day033b.png"><img class="alignright size-thumbnail wp-image-1199" title="day033b" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/02/day033b-150x150.png" alt="" width="150" height="150" /></a>I&#8217;m happy that things are taking a turn, I&#8217;d hate to end the year with a majority output of still-looking sketches of varying quality. The range of media, and the developing themes I&#8217;m following are giving me lots to think about, much to enjoy and more to look forward to.</p>
<p>Continuing the slightly obscure theme, this is the first digital work of the project, <em>Illustrator</em> and a little <em>Photoshop</em>.</p>
<p>I do not smoke, I never have. I do own a pipe, and a plastic bull.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/day-33-moo-cough-and-i/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<enclosure url="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/02/day033a-150x150.png" length="2281" type="image/jpg" />	</item>
		<item>
		<title>Day 32, the ready-made</title>
		<link>http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/moo-cough/</link>
		<comments>http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/moo-cough/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 23:17:36 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[One self-portrait a day 2012]]></category>
		<category><![CDATA[assemblage]]></category>
		<category><![CDATA[ready-made]]></category>

		<guid isPermaLink="false">http://codeandeffect.co.uk/blog/?p=1190</guid>
		<description><![CDATA[I had intended to take this assemblage home and set it up for painting when I realised today&#8217;s self-portrait was done, dusted and in my hands. This is the point where this project gets alot more interesting, and personal.]]></description>
			<content:encoded><![CDATA[<div id="attachment_1191" class="wp-caption aligncenter" style="width: 510px"><img class=" wp-image-1191  " title="February 1st" src="http://codeandeffect.s3-website-eu-west-1.amazonaws.com/uploads/2012/02/day0321.jpg" alt="February 1st" width="500" height="500" /><p class="wp-caption-text">February 1st</p></div>
<p>I had intended to take this assemblage home and set it up for painting when I realised today&#8217;s self-portrait was done, dusted and in my hands.</p>
<p>This is the point where this project gets alot more interesting, and personal.</p>
]]></content:encoded>
			<wfw:commentRss>http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/moo-cough/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	<enclosure url="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/02/day032-150x150.jpg" length="4520" type="image/jpg" />	</item>
		<item>
		<title>January draws to a close</title>
		<link>http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/january-draws-to-a-close/</link>
		<comments>http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/january-draws-to-a-close/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 15:00:20 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[One self-portrait a day 2012]]></category>
		<category><![CDATA[drawing]]></category>

		<guid isPermaLink="false">http://codeandeffect.co.uk/blog/?p=1149</guid>
		<description><![CDATA[Here&#8217;re the final self-portraits for January, representing a return to hasty. Again, I&#8217;ve been very busy in other areas of life so time for portraiture has been slim. Taking a line for a walk January 23rd was a good day, &#8230; <a href="http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/january-draws-to-a-close/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;re the final self-portraits for January, representing a return to <em>hasty</em>. </p>

<a href='http://codeandeffect.co.uk/blog/?attachment_id=1140' title='January 23rd - 1'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/01/day023a-150x150.jpg" class="attachment-thumbnail" alt="January 23rd - 1" title="January 23rd - 1" /></a>
<a href='http://codeandeffect.co.uk/blog/?attachment_id=1141' title='January 23rd - 2'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/01/day_023b-150x150.jpg" class="attachment-thumbnail" alt="January 23rd - 2" title="January 23rd - 2" /></a>
<a href='http://codeandeffect.co.uk/blog/?attachment_id=1142' title='January 23rd - 3'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/01/day_023c-150x150.jpg" class="attachment-thumbnail" alt="January 23rd - 3" title="January 23rd - 3" /></a>
<a href='http://codeandeffect.co.uk/blog/?attachment_id=1143' title='January 24th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/01/day_024-150x150.jpg" class="attachment-thumbnail" alt="January 24th" title="January 24th" /></a>
<a href='http://codeandeffect.co.uk/blog/?attachment_id=1144' title='January 25th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/01/day025-150x150.jpg" class="attachment-thumbnail" alt="January 25th" title="January 25th" /></a>
<a href='http://codeandeffect.co.uk/blog/?attachment_id=1145' title='January 26th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/01/day026-150x150.jpg" class="attachment-thumbnail" alt="January 26th" title="January 26th" /></a>
<a href='http://codeandeffect.co.uk/blog/?attachment_id=1146' title='January 27th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/01/day027-150x150.jpg" class="attachment-thumbnail" alt="January 27th" title="January 27th" /></a>
<a href='http://codeandeffect.co.uk/blog/?attachment_id=1147' title='January 28th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/01/day028-150x150.jpg" class="attachment-thumbnail" alt="January 28th" title="January 28th" /></a>
<a href='http://codeandeffect.co.uk/blog/?attachment_id=1148' title='January 29th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/01/day029-150x150.jpg" class="attachment-thumbnail" alt="January 29th" title="January 29th" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/january-draws-to-a-close/attachment/day030b/' title='January 30th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/01/day030b-150x150.jpg" class="attachment-thumbnail" alt="January 30th" title="January 30th" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/january-draws-to-a-close/attachment/day031/' title='January 31st'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/01/day031-150x150.jpg" class="attachment-thumbnail" alt="January 31st" title="January 31st" /></a>

<p>Again, I&#8217;ve been very busy in other areas of life so time for portraiture has been slim.</p>
<h3>Taking a line for a walk</h3>
<div id="attachment_1141" class="wp-caption alignright" style="width: 160px"><a href="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/01/day_023b.jpg"><img class="size-thumbnail wp-image-1141 " title="January 23rd - 2" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/01/day_023b-150x150.jpg" alt="January 23rd - 2" width="150" height="150" /></a><p class="wp-caption-text">January 23rd</p></div>
<p>January 23rd was a good day, there&#8217;re two images here drawn using a single line, from the view in a mirror and with no glancing at the paper  &#8211; so features appear all over the place. They were then photographed in negative. I&#8217;m particularly happy with how expressive these two are.</p>
<p>There were too many quick sketches last week (even on café napkins), and again I&#8217;ve considered halting &#8216;<a title="One self-portrait a day category" href="/blog/category/one-self-portrait-a-day-2012/">one self-portrait a day</a>&#8216; in favour of longer term projects.</p>
<p>However, I keep coming back to the ideas I&#8217;ve not yet explored, such as abstraction and typographic treatments that could be executed in a short time.</p>
<p>In the coming weeks I&#8217;m going to consider applying themes to a week&#8217;s output, as a means of ensuring I explore something new every day.</p>
]]></content:encoded>
			<wfw:commentRss>http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/january-draws-to-a-close/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<enclosure url="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/01/day030b-150x150.jpg" length="7580" type="image/jpg" />	</item>
		<item>
		<title>Project Euler, problem 5</title>
		<link>http://codeandeffect.co.uk/blog/2012/euler-problems/project-euler-problem-5/</link>
		<comments>http://codeandeffect.co.uk/blog/2012/euler-problems/project-euler-problem-5/#comments</comments>
		<pubDate>Fri, 27 Jan 2012 14:00:30 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Euler Problems]]></category>

		<guid isPermaLink="false">http://codeandeffect.co.uk/blog/?p=1111</guid>
		<description><![CDATA[2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20? &#8230; <a href="http://codeandeffect.co.uk/blog/2012/euler-problems/project-euler-problem-5/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<blockquote><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></blockquote>
<p>This one needed some rambling thought before I settled down to an approach. I had thought that there should be a more effective method than simply counting upwards while testing each number in the range.</p>
<p>I settled on the simple approach when I realised that when checking the current highest number, you can skip all remaining items in the range should there be a single failure to evenly divide.</p>
<p>My brief, if inelegant solution &#8211; which I&#8217;ll hopefully refine in the next few days &#8211; is copied below (written in Ruby). I can&#8217;t help but think there are ways to:</p>
<ul>
<li>cut down the number of division checks</li>
<li>increment the high number by greater degrees each time</li>
</ul>
<p>So plenty still to examine with this one.</p>
<div class="codecolorer-container ruby geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#ff6633; font-weight:bold;">$greatestNumber</span> = <span style="color:#006666;">1</span><br />
<span style="color:#9966CC; font-weight:bold;">def</span> checkHigh<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <br />
&nbsp; rangeLow = <span style="color:#006666;">1</span><br />
&nbsp; rangeHigh = <span style="color:#006666;">20</span><br />
&nbsp; i = &nbsp;rangeHigh &nbsp;<br />
&nbsp; singleNumbersNonRemainDivCount = <span style="color:#006666;">0</span><br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">while</span> i <span style="color:#006600; font-weight:bold;">&gt;</span>= rangeLow<br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>$greatestNumber <span style="color:#006600; font-weight:bold;">%</span> i<span style="color:#006600; font-weight:bold;">&#41;</span> &nbsp; <span style="color:#006600; font-weight:bold;">&gt;</span> <span style="color:#006666;">0</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; singleNumbersNonRemainDivCount=<span style="color:#006666;">0</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#ff6633; font-weight:bold;">$greatestNumber</span> = <span style="color:#ff6633; font-weight:bold;">$greatestNumber</span><span style="color:#006600; font-weight:bold;">+</span><span style="color:#006666;">1</span> &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; i = rangeHigh &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; singleNumbersNonRemainDivCount=singleNumbersNonRemainDivCount<span style="color:#006600; font-weight:bold;">+</span><span style="color:#006666;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">if</span> singleNumbersNonRemainDivCount == rangeHigh<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Highest number: #{$greatestNumber}&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#ff6633; font-weight:bold;">$greatestNumber</span> &nbsp; = <span style="color:#ff6633; font-weight:bold;">$greatestNumber</span><span style="color:#006600; font-weight:bold;">-</span><span style="color:#006666;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; i=i<span style="color:#006600; font-weight:bold;">-</span><span style="color:#006666;">1</span><br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span> <br />
checkHigh<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://codeandeffect.co.uk/blog/2012/euler-problems/project-euler-problem-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Only 344 days to go</title>
		<link>http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/only-344-days-to-go/</link>
		<comments>http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/only-344-days-to-go/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 12:45:46 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[One self-portrait a day 2012]]></category>
		<category><![CDATA[one self-portrait a day]]></category>
		<category><![CDATA[painting]]></category>
		<category><![CDATA[printing]]></category>

		<guid isPermaLink="false">http://codeandeffect.co.uk/blog/?p=1084</guid>
		<description><![CDATA[Here&#8217;s the crop of self-portraits from the last week: January 16th: A frustrating start to the week &#8211; a small oil study that I had to abandon. I took a rag to the wet surface in the hope of resurrecting &#8230; <a href="http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/only-344-days-to-go/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s the crop of self-portraits from the last week:</p>

<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/only-344-days-to-go/attachment/day016/' title='January 16th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/01/day016-150x150.jpg" class="attachment-thumbnail" alt="January 16th" title="January 16th" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/only-344-days-to-go/attachment/day017/' title='January 17th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/01/day017-150x150.jpg" class="attachment-thumbnail" alt="January 17th" title="January 17th" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/only-344-days-to-go/attachment/day018a/' title='January 18th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/01/day018a-150x150.jpg" class="attachment-thumbnail" alt="January 18th" title="January 18th" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/only-344-days-to-go/attachment/day019/' title='January 19th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/01/day019-150x150.jpg" class="attachment-thumbnail" alt="January 19th" title="January 19th" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/only-344-days-to-go/attachment/day020/' title='January 20th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/01/day020-150x150.jpg" class="attachment-thumbnail" alt="January 20th" title="January 20th" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/only-344-days-to-go/attachment/day021/' title='January 21st'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/01/day021-150x150.jpg" class="attachment-thumbnail" alt="January 21st" title="January 21st" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/only-344-days-to-go/attachment/day022/' title='January 22nd'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/01/day022-150x150.jpg" class="attachment-thumbnail" alt="January 22nd" title="January 22nd" /></a>

<h3>January 16th:</h3>
<p>A frustrating start to the week &#8211; a small oil study that I had to abandon. I took a rag to the wet surface in the hope of resurrecting it at some point.</p>
<h3>January 17th:</h3>
<p>I returned to pencil &amp; cartridge paper, looking at the shots I took of this showed me I need to watch my shading &#8211; I did some corrections before uploading the day&#8217;s final image.</p>
<h3>January 18th:</h3>
<p>Light blue letraset marker on watercolour paper, stood very close to the mirror.</p>
<h3>January 19th:</h3>
<p>Heavily sleep deprived in this one, so no smiles. Enjoyed the differences made by holding my head &#8211; fold&#8217;s around the eyes and more interesting shadows.</p>
<h3>January 20th:</h3>
<p>A quick follow up of the same themes on the next night &#8211; having had some sleep. Again some tonal adjustments made with an eraser before finalising.</p>
<h3>January 21st:</h3>
<p>A total departure &#8211; animal transformation for a start, and my first linocut print in more years than I care to recall.</p>
<p>Linocut is very rewarding &#8211; the design was drawn up in a sketchbook and applied in pencil then ink, but was being adapted during the cutting process. Cutting took about an hour to complete. I had hoped printing would have been more successful, so I&#8217;ll be working on the home pressing techniques.</p>
<h3>January 222nd:</h3>
<p>After last night&#8217;s lino print, I&#8217;d tried to get a monoprint from the remaining ink on the glass but was unsucessful. I rolled the ink evenly again and left it to dry so that today I could scratch into it directly and then backlight it, here&#8217;s the result of some swift scratching.</p>
<h3>media</h3>
<p>I&#8217;ve thought alot about media this week &#8211; particularly grounds and supports &#8211; with an anything-goes mindset.</p>
<p>I&#8217;ve tried painting on a (spare, unused) smoke alarm (pencil works well, but using an eraser was surprisingly problematic given the plastic surface) and I&#8217;m now considering what can be achieved with other materials as either a support or a sculptural / relief material.</p>
<p>Expect noodles.</p>
<h3>How it&#8217;s going</h3>
<p>I&#8217;ve been tempted this week to adapt (at best) or abandon the whole project &#8211; mainly because it&#8217;s already provided me with the intended results &#8211; I&#8217;m working creatively, regularly and in range of media.</p>
<p>I now have a list of painting, printing and other works I want to begin, so producing a daily portrait can seem like a burden.</p>
<p>Perhaps &#8216;one self-portrait a fortnight&#8217; will be the way to go? For now I&#8217;m going to persevere. I&#8217;ve proved I can make the time so I&#8217;ll try to get some longer-term projects running in parallel.</p>
]]></content:encoded>
			<wfw:commentRss>http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/only-344-days-to-go/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<enclosure url="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/01/day016-150x150.jpg" length="5962" type="image/jpg" />	</item>
		<item>
		<title>Project Euler problem 8</title>
		<link>http://codeandeffect.co.uk/blog/2012/euler-problems/project-euler-problem-8/</link>
		<comments>http://codeandeffect.co.uk/blog/2012/euler-problems/project-euler-problem-8/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 14:00:57 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Euler Problems]]></category>

		<guid isPermaLink="false">http://codeandeffect.co.uk/blog/?p=1046</guid>
		<description><![CDATA[The latest in a series of paired-up problem workings with Greg Bowie. This week we&#8217;re looking at Problem 8: Discover the largest product of five consecutive digits in a the [provided] 1000-digit number Here&#8217;s my response, longhand: I&#8217;ll need a &#8230; <a href="http://codeandeffect.co.uk/blog/2012/euler-problems/project-euler-problem-8/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The latest in a series of paired-up problem workings with Greg Bowie. This week we&#8217;re looking at <a title="Project Euler Problem 8" href="http://projecteuler.net/problem=8" target="_blank">Problem 8</a>:</p>
<blockquote><p>Discover the largest product of five consecutive digits in a the <span style="color: #808080;"><em>[<a title=" Click to view the number provided" href="javascript:alert('Number provided:\n73167176531330624919225119674426574742355349194934\n 96983520312774506326239578318016984801869478851843\n 85861560789112949495459501737958331952853208805511\n 12540698747158523863050715693290963295227443043557\n 66896648950445244523161731856403098711121722383113\n 62229893423380308135336276614282806444486645238749\n 30358907296290491560440772390713810515859307960866\n 70172427121883998797908792274921901699720888093776\n 65727333001053367881220235421809751254540594752243\n 52584907711670556013604839586446706324415722155397\n 53697817977846174064955149290862569321978468622482\n 83972241375657056057490261407972968652414535100474\n 82166370484403199890008895243450658541227588666881\n 16427171479924442928230863465674813919123162824586\n 17866458359124566529476545682848912883142607690042\n 24219022671055626321111109370544217506941658960408\n 07198403850962455444362981230987879927244284909188\n 84580156166097919133875499200524063689912560717606\n 05886116467109405077541002256983155200055935729725\n 71636269561882670428252483600823257530420752963450\n\n')">provided</a>]</em></span> 1000-digit number</p></blockquote>
<p>Here&#8217;s my response, longhand:</p>
<ol>
<li>I&#8217;ll need a variable to store the (current) value of the greatest product</li>
<li>I&#8217;ll need to iterate through the 1000-digit number, reading 5 digits at a time working out the product of each sequence, stepping one digit on with every iteration.</li>
<li>The routine will begin from the 1st digit. The process will stop 5 digits of the final digit</li>
<li>Using variables to store the length of the 1000-digit number and the number of digits we&#8217;re deriving the product of would make the solution more adaptable for other numbers and sequences</li>
<li>Each product retrieved from every sequence of 5 digits must be compared to the current greatest product. If this exceeds the current greatest product, we set this as the new greatest product</li>
</ol>
<p>This should solve the problem, but why stop now?</p>
<h3>Refinements</h3>
<p>The presence of zeros in the 1000-digit number is notable &#8211; any zero encountered while examining the product of multiple digits will result in a zero product. So I&#8217;ll ignore them:</p>
<ol>
<li>Create an array of smaller numbers by splitting the 1000-digit number by any zero digit &#8211; handling sequences of zeros so as to prevent empty array items</li>
<li>Iterate through each of these numbers, deriving the product of each set of 5 digits, and checking this against the current greatest product</li>
</ol>
<p>Chances are this refinement will not improve the performance of this test on a single number, but as it reduces the number of product-derivation runs by 398 by it may scale well, depending on the language.</p>
<div class="codecolorer-container ruby geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ratherLongNumber = <span style="color:#006666;">73167176531330624919225</span>...<br />
<span style="color:#9900CC;">numDigits</span> = ratherLongNumber.<span style="color:#9900CC;">to_s</span>.<span style="color:#9900CC;">length</span><br />
considerRange = <span style="color:#006666;">5</span><br />
totalcomparisons = <span style="color:#006666;">0</span><br />
<span style="color:#ff6633; font-weight:bold;">$greatestProduct</span> = <span style="color:#006666;">0</span><br />
<span style="color:#9966CC; font-weight:bold;">while</span> totalcomparisons range = ratherLongNumber.<span style="color:#9900CC;">to_s</span><span style="color:#006600; font-weight:bold;">&#91;</span>totalcomparisons,<span style="color:#006666;">5</span><span style="color:#006600; font-weight:bold;">&#93;</span><br />
rangeproduct = range.<span style="color:#CC0066; font-weight:bold;">split</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">//</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">map</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&amp;</span>amp;:to_i<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">inject</span><span style="color:#006600; font-weight:bold;">&#40;</span>:<span style="color:#006600; font-weight:bold;">*</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
<span style="color:#ff6633; font-weight:bold;">$greatestProduct</span> = <span style="color:#ff6633; font-weight:bold;">$greatestProduct</span><span style="color:#006600; font-weight:bold;">&amp;</span>gt;rangeproduct ? <span style="color:#ff6633; font-weight:bold;">$greatestProduct</span>:rangeproduct<br />
totalcomparisons=totalcomparisons<span style="color:#006600; font-weight:bold;">+</span><span style="color:#006666;">1</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span><br />
<span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;#{$greatestProduct}&quot;</span></div></div>
<p>Refined version:</p>
<div class="codecolorer-container ruby geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ratherLongNumber = <span style="color:#006666;">73167176531330624919225</span>...<br />
<span style="color:#9966CC; font-weight:bold;">def</span> getProductOfRange<span style="color:#006600; font-weight:bold;">&#40;</span>inputNumber,considerRange<span style="color:#006600; font-weight:bold;">&#41;</span><br />
<span style="color:#008000; font-style:italic;"># puts inputNumber</span><br />
numberofcomparisons = <span style="color:#006666;">0</span><br />
localGreatestRange = <span style="color:#006666;">0</span><br />
<span style="color:#9966CC; font-weight:bold;">while</span> numberofcomparisons range = inputNumber.<span style="color:#9900CC;">to_s</span><span style="color:#006600; font-weight:bold;">&#91;</span>numberofcomparisons,<span style="color:#006666;">5</span><span style="color:#006600; font-weight:bold;">&#93;</span><br />
rangeproduct = range.<span style="color:#CC0066; font-weight:bold;">split</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">//</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">map</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&amp;</span>amp;:to_i<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">inject</span><span style="color:#006600; font-weight:bold;">&#40;</span>:<span style="color:#006600; font-weight:bold;">*</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
numberofcomparisons=numberofcomparisons<span style="color:#006600; font-weight:bold;">+</span><span style="color:#006666;">1</span><br />
localGreatestRange = localGreatestRange<span style="color:#006600; font-weight:bold;">&amp;</span>gt;rangeproduct ? localGreatestRange:rangeproduct<br />
<span style="color:#9966CC; font-weight:bold;">end</span><br />
<span style="color:#0000FF; font-weight:bold;">return</span> localGreatestRange ,numberofcomparisons<br />
<span style="color:#9966CC; font-weight:bold;">end</span><br />
<span style="color:#ff6633; font-weight:bold;">$greatestProduct</span> = <span style="color:#006666;">0</span><br />
arrayOfNumbers = ratherLongNumber.<span style="color:#9900CC;">to_s</span>.<span style="color:#CC0066; font-weight:bold;">split</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">+/</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">map</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&amp;</span>amp;:to_i<span style="color:#006600; font-weight:bold;">&#41;</span><br />
arrayOfNumbers.<span style="color:#9900CC;">each</span><span style="color:#006600; font-weight:bold;">&#123;</span><br />
<span style="color:#006600; font-weight:bold;">|</span>a<span style="color:#006600; font-weight:bold;">|</span><br />
tmp2,comparisons = getProductOfRange<span style="color:#006600; font-weight:bold;">&#40;</span>a,<span style="color:#006666;">5</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
<span style="color:#ff6633; font-weight:bold;">$greatestProduct</span> = <span style="color:#ff6633; font-weight:bold;">$greatestProduct</span><span style="color:#006600; font-weight:bold;">&amp;</span>gt;tmp2 ? <span style="color:#ff6633; font-weight:bold;">$greatestProduct</span>:tmp2<br />
<span style="color:#006600; font-weight:bold;">&#125;</span><br />
<span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;#{$greatestProduct}&quot;</span></div></div>
<p>here&#8217;s <a href="http://gregorbowie.wordpress.com/2012/01/20/euler-problem-8/">Greg&#8217;s response</a>, posted simultaneously today.</p>
<p>update 23/01/2012:</p>
<p>Revisiting this afresh I realise there&#8217;re other ways to skip those pesky zeros, rather than drop them into an array, better to simply skip past any such sequence:</p>
<div class="codecolorer-container ruby geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ratherLongNumber = <span style="color:#006666;">73167176531330624919225</span>...<br />
<span style="color:#9900CC;">numDigits</span> = ratherLongNumber.<span style="color:#9900CC;">to_s</span>.<span style="color:#9900CC;">length</span><br />
considerRange = <span style="color:#006666;">5</span><br />
greatestProduct = <span style="color:#006666;">0</span><br />
cursor = <span style="color:#006666;">0</span><br />
skipped = <span style="color:#006666;">0</span><br />
<span style="color:#9966CC; font-weight:bold;">while</span> cursor <span style="color:#006600; font-weight:bold;">&amp;</span>lt;= numDigits<span style="color:#006600; font-weight:bold;">-</span>considerRange<br />
range = ratherLongNumber.<span style="color:#9900CC;">to_s</span><span style="color:#006600; font-weight:bold;">&#91;</span>cursor,considerRange<span style="color:#006600; font-weight:bold;">&#93;</span><br />
<span style="color:#9966CC; font-weight:bold;">if</span> range.<span style="color:#9900CC;">index</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'0'</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
cursor=<span style="color:#006600; font-weight:bold;">&#40;</span>cursor<span style="color:#006600; font-weight:bold;">+</span>range.<span style="color:#9900CC;">index</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'0'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">+</span><span style="color:#006666;">1</span><br />
skipped=skipped<span style="color:#006600; font-weight:bold;">+</span><span style="color:#006666;">1</span><br />
<span style="color:#9966CC; font-weight:bold;">else</span><br />
rangeproduct = range.<span style="color:#CC0066; font-weight:bold;">split</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">//</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">map</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&amp;</span>amp;:to_i<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">inject</span><span style="color:#006600; font-weight:bold;">&#40;</span>:<span style="color:#006600; font-weight:bold;">*</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
greatestProduct = greatestProduct<span style="color:#006600; font-weight:bold;">&amp;</span>gt;rangeproduct ? greatestProduct:rangeproduct<br />
cursor=cursor<span style="color:#006600; font-weight:bold;">+</span><span style="color:#006666;">1</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span><br />
<span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Greatest Product: #{greatestProduct}&quot;</span><br />
<span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;#{skipped} sequences with zero in the #{considerRange}-digit range skipped&quot;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://codeandeffect.co.uk/blog/2012/euler-problems/project-euler-problem-8/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A second week of self</title>
		<link>http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/one-self-portrait-a-day-2/</link>
		<comments>http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/one-self-portrait-a-day-2/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 15:28:48 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[One self-portrait a day 2012]]></category>
		<category><![CDATA[drawing]]></category>
		<category><![CDATA[painting]]></category>

		<guid isPermaLink="false">http://codeandeffect.co.uk/blog/?p=940</guid>
		<description><![CDATA[Week two: surreal, desperate, but going in the right direction. At the start of the week I found I could get a likeness without looking, just idly doodling in sketchbook. This is bad news, it&#8217;s the process of observation that&#8217;s &#8230; <a href="http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/one-self-portrait-a-day-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/one-self-portrait-a-day-2/attachment/day009/' title='Day 9'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/01/day009-150x150.jpg" class="attachment-thumbnail" alt="Day 9" title="Day 9" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/one-self-portrait-a-day-2/attachment/day010/' title='Day 10'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/01/day010-150x150.jpg" class="attachment-thumbnail" alt="Day 10" title="Day 10" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/one-self-portrait-a-day-2/attachment/day011/' title='Day 11'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/01/day011-150x150.jpg" class="attachment-thumbnail" alt="Day 11" title="Day 11" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/one-self-portrait-a-day-2/attachment/day_012/' title='Day 12'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/01/day_012-150x150.jpg" class="attachment-thumbnail" alt="Day 12" title="Day 12" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/one-self-portrait-a-day-2/attachment/day013/' title='Day 13'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/01/day013-150x150.jpg" class="attachment-thumbnail" alt="Day 13" title="Day 13" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/one-self-portrait-a-day-2/attachment/day014/' title='Day 14'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/01/day014-150x150.jpg" class="attachment-thumbnail" alt="Day 14" title="Day 14" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/one-self-portrait-a-day-2/attachment/day015/' title='Day 15'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/01/day015-150x150.jpg" class="attachment-thumbnail" alt="Day 15" title="Day 15" /></a>

<p>Week two: surreal, desperate, but going in the right direction.</p>
<p>At the start of the week I found I could get a likeness without looking, just idly doodling in sketchbook. This is bad news, it&#8217;s the process of observation that&#8217;s important, not the ability to recall. So I&#8217;ve tried to take more time over the plain, representational ones this week.</p>
<p>I&#8217;ve thrown in some other approaches too &#8211; depicting my face upon a small matryoshka doll stood upon a notebook (&#8216;that&#8217;s rather sinister&#8217; was one response), and another looking out over the river but will odd, converging shadows.</p>
<p>I am still not producing the kind of work I would like to, but the journey&#8217;s begun and most importantly I&#8217;m thinking far more, and further ahead.</p>
<p>Available time remains a big factor. Thankfully at the weekend I had some time to run through various ideas and use some other media.</p>
]]></content:encoded>
			<wfw:commentRss>http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/one-self-portrait-a-day-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<enclosure url="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/01/day009-150x150.jpg" length="6780" type="image/jpg" />	</item>
		<item>
		<title>Project Euler problem 4</title>
		<link>http://codeandeffect.co.uk/blog/2012/euler-problems/project-euler-problem-4/</link>
		<comments>http://codeandeffect.co.uk/blog/2012/euler-problems/project-euler-problem-4/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 21:16:42 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Euler Problems]]></category>

		<guid isPermaLink="false">http://codeandeffect.co.uk/blog/?p=1016</guid>
		<description><![CDATA[Here&#8217;s the first of my responses to the Euler problems I&#8217;m working through in parallel with ex-colleague and fellow code-charmer Greg Bowie. Each week we&#8217;ll tackle one of the problems (in isolation) and post our respective responses each Friday &#8211; workloads &#8230; <a href="http://codeandeffect.co.uk/blog/2012/euler-problems/project-euler-problem-4/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s the first of my responses to the Euler problems I&#8217;m working through in parallel with ex-colleague and fellow code-charmer <a href="http://gregorbowie.wordpress.com/">Greg Bowie</a>.</p>
<p>Each week we&#8217;ll tackle one of the problems (in isolation) and post our respective responses each Friday &#8211; workloads permitting &#8211; at around 3pm. This week Greg chose <a title="Euler Problem 4" href="http://projecteuler.net/problem=4">Problem 4</a><br />
<span id="more-1016"></span></p>
<blockquote><p>A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 x 99.</p>
<p>Find the largest palindrome made from the product of two 3-digit numbers</p></blockquote>
<p>Here&#8217;s <a title="Greg's response to Problem 4" href="http://gregorbowie.wordpress.com/2012/01/13/euler-problem-4/">Greg&#8217;s response</a> and rationale, while my Ruby response can be found below.</p>
<h3>Initial thought</h3>
<p>I began by determining the highest and lowest products achievable from two 3-digit numbers. the target palindrome will exist in this range. This gave me 10,000 at lowest (100 x 100) up to 998,0001 at highest (999 x 999).</p>
<p>As the highest number ended &#8216;..001&#8242; the palindrome had to begin &#8217;997&#8230;&#8217;, so I was looking for 997799.</p>
<h3>Hunting palindromes</h3>
<p>As we&#8217;re aiming for the highest palindrome, the while loop counts down from the highest number, decrementing itself as it goes and exiting when the palindrome&#8217;s found. With the loop in place I wrote the palindrome hunter method, which:</p>
<ul>
<li>Converts the current high number  to a string</li>
<li>substrings the first three characters</li>
<li>Creates a variable for a character-reversed version of the number</li>
<li>Compare the first 3 characters of the two strings &#8211; if matched the loop ends and the palindrome is returned</li>
</ul>
<p>Here&#8217;s how it looks in Ruby:</p>
<div class="codecolorer-container ruby geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#ff6633; font-weight:bold;">$starthighest</span> = <span style="color:#006666;">998001</span> <span style="color:#008000; font-style:italic;"># 999 * 999</span><br />
<span style="color:#ff6633; font-weight:bold;">$lowest</span> = <span style="color:#006666;">10000</span> <span style="color:#008000; font-style:italic;"># 100 * 100</span><br />
<span style="color:#9966CC; font-weight:bold;">def</span> checkPal<br />
&nbsp; rev = <span style="color:#996600;">&quot;&quot;</span> <span style="color:#008000; font-style:italic;">#declare string</span><br />
&nbsp; <span style="color:#ff6633; font-weight:bold;">$starthighest</span>.<span style="color:#9900CC;">to_s</span>.<span style="color:#9900CC;">each_char</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>i<span style="color:#006600; font-weight:bold;">|</span><br />
&nbsp; rev.<span style="color:#9900CC;">prepend</span><span style="color:#006600; font-weight:bold;">&#40;</span>i<span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>$starthighest.<span style="color:#9900CC;">to_s</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">1</span>,<span style="color:#006666;">3</span><span style="color:#006600; font-weight:bold;">&#93;</span> == rev<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">1</span>,<span style="color:#006666;">3</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> &nbsp;<br />
&nbsp; &nbsp; <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;The largest palindrome from two 3-digit numbers is #{$starthighest.to_s}&quot;</span><br />
&nbsp; &nbsp; <span style="color:#ff6633; font-weight:bold;">$starthighest</span> = <span style="color:#ff6633; font-weight:bold;">$lowest</span><br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">else</span> &nbsp;<br />
&nbsp; &nbsp; <span style="color:#ff6633; font-weight:bold;">$starthighest</span> = <span style="color:#ff6633; font-weight:bold;">$starthighest</span> <span style="color:#006600; font-weight:bold;">-</span><span style="color:#006666;">1</span><br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span><br />
<span style="color:#9966CC; font-weight:bold;">while</span> <span style="color:#ff6633; font-weight:bold;">$starthighest</span> <span style="color:#006600; font-weight:bold;">&gt;</span> <span style="color:#ff6633; font-weight:bold;">$lowest</span><br />
&nbsp; checkPal<br />
<span style="color:#9966CC; font-weight:bold;">end</span></div></div>
<h3>Notes</h3>
<p>As the palindrome will be either 5 or 6 characters long, this method of substrings and reversal allows for overlap without ever having to measure the string length.</p>
<p>Sometimes frowned upon, here I&#8217;ve used global variables as the highest number is used both as the loop iterator and the string for comparison. This also allowed me a cleaner, parameter-free method definition.</p>
<p>Now I have to go and pick next week&#8217;s problem&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://codeandeffect.co.uk/blog/2012/euler-problems/project-euler-problem-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

