<?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, 12 Mar 2012 08:06:30 +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>Flight checking values for Propel</title>
		<link>http://codeandeffect.co.uk/blog/2012/programming/php/flight-checking-values-for-propel/</link>
		<comments>http://codeandeffect.co.uk/blog/2012/programming/php/flight-checking-values-for-propel/#comments</comments>
		<pubDate>Mon, 12 Mar 2012 08:06:30 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://codeandeffect.co.uk/blog/?p=1371</guid>
		<description><![CDATA[I&#8217;m using Propel ORM (v 1.6.4) for a new development and came across a limitation with validators. I&#8217;d hoped to use Propel validation rule messages to inform my users of bad input, but for some data types you need to &#8230; <a href="http://codeandeffect.co.uk/blog/2012/programming/php/flight-checking-values-for-propel/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m using <a href="http://www.propelorm.org/" target="new">Propel ORM</a> (v 1.6.4) for a new development and came across a limitation with validators. I&#8217;d hoped to use Propel validation rule messages to inform my users of bad input, but for some data types you need to provide correctly formatted input first time:</p>
<div class="codecolorer-container text geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$starting_date = sanitise($_GET['starting_date']);<br />
// user mistyped date: '03/08/20q2'<br />
$event-&gt;setStartDate($starting_date); <br />
//Fatal Propel Exception here!</div></div>
<p>If you can&#8217;t set your date field, you can&#8217;t validate it. In turn this means you need your own form validation ahead of your Propel functionality.</p>
<p>The following sample ( a new function in my &#8216;Event&#8217; class) goes some way to solving this. It allows you to pre-validate form entry using a Propel custom validator you specify and will return a Propel failure message as set in your schema validation rules.</p>
<p>Here&#8217;s the usage:</p>
<div class="codecolorer-container text geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">...<br />
<br />
if ($_GET['starting_date'] ):<br />
$event = new Event();<br />
$sanitisedFormVal = sanitise($_GET['starting_date']);<br />
if ($check = $event-&gt;flightCheckFail('StartingDate','DateValidator',$sanitisedFormVal)) {echo $check;}<br />
else { $event-&gt;setStartingDate($sanitisedFormVal);}<br />
...</div></div>
<p>and here&#8217;s the Event class:</p>
<div class="codecolorer-container text geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">class Event extends BaseEvent {<br />
public function flightCheckFail($name,$validatorClass,$value) {<br />
$colname = $this-&gt;getPeer()-&gt;getTableMap()-&gt;getColumnByPhpName($name)-&gt;getName();<br />
$validators = $this-&gt;getPeer()-&gt;getTableMap()-&gt;getColumn($colname)&gt;getValidators();<br />
foreach($validators as $validatorMap) {<br />
if ($validatorMap-&gt;getClass()==$validatorClass) {<br />
$validator = BasePeer::getValidator($validatorMap&gt;getClass());<br />
if ( $validator-&gt;isValid($validatorMap, $value) === false) {<br />
$failureMessage =  $validatorMap-&gt;getMessage();<br />
}<br />
}<br />
}<br />
if($failureMessage) {return $failureMessage;}<br />
else {return false;}<br />
}<br />
} // Event</div></div>
<p>The function <em>flightCheckFail</em> rifles through the Propel object&#8217;s generated Peer and Map classes and injects the value you would set into a validation request. </p>
<p>If it fails, you get the Propel rule failure message back, which you can return to your user. </p>
<p>If the value passes validation, <em>flightCheckFail</em> returns false and you&#8217;re safe to <em>setXXX</em> the value in your Propel object. </p>
<p>You can read about the original problem as it presented itself on <a href="http://stackoverflow.com/questions/9570570/propel-orm-version-1-6-4-understanding-validators" target="new">Stack Overflow</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://codeandeffect.co.uk/blog/2012/programming/php/flight-checking-values-for-propel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A sorry crop for late February and early March</title>
		<link>http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/a-sorry-crop-for-late-february-and-early-march/</link>
		<comments>http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/a-sorry-crop-for-late-february-and-early-march/#comments</comments>
		<pubDate>Fri, 09 Mar 2012 18:29:32 +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=1434</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/a-sorry-crop-for-late-february-and-early-march/attachment/day051/' title='February 20th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/03/day051-150x150.jpg" class="attachment-thumbnail" alt="February 20th" title="February 20th" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/a-sorry-crop-for-late-february-and-early-march/attachment/day052/' title='February 21st'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/03/day052-150x150.jpg" class="attachment-thumbnail" alt="February 21st" title="February 21st" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/a-sorry-crop-for-late-february-and-early-march/attachment/day053/' title='February 22nd'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/03/day053-150x150.jpg" class="attachment-thumbnail" alt="February 22nd" title="February 22nd" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/a-sorry-crop-for-late-february-and-early-march/attachment/day054/' title='February 23rd'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/03/day054-150x150.jpg" class="attachment-thumbnail" alt="February 23rd" title="February 23rd" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/a-sorry-crop-for-late-february-and-early-march/attachment/day055/' title='February 24th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/03/day055-150x150.jpg" class="attachment-thumbnail" alt="February 24th" title="February 24th" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/a-sorry-crop-for-late-february-and-early-march/attachment/day056/' title='February 25th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/03/day056-150x150.jpg" class="attachment-thumbnail" alt="February 25th" title="February 25th" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/a-sorry-crop-for-late-february-and-early-march/attachment/day057/' title='February 26th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/03/day057-150x150.jpg" class="attachment-thumbnail" alt="February 26th" title="February 26th" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/a-sorry-crop-for-late-february-and-early-march/attachment/day058/' title='February 27th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/03/day058-150x150.jpg" class="attachment-thumbnail" alt="February 27th" title="February 27th" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/a-sorry-crop-for-late-february-and-early-march/attachment/day059/' title='February 28th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/03/day059-150x150.jpg" class="attachment-thumbnail" alt="February 28th" title="February 28th" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/a-sorry-crop-for-late-february-and-early-march/attachment/day060/' title='February 29th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/03/day060-150x150.jpg" class="attachment-thumbnail" alt="February 29th" title="February 29th" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/a-sorry-crop-for-late-february-and-early-march/attachment/day061/' title='March 1st'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/03/day061-150x150.jpg" class="attachment-thumbnail" alt="March 1st" title="March 1st" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/a-sorry-crop-for-late-february-and-early-march/attachment/day062/' title='March 2nd'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/03/day062-e1331310499975-150x150.jpg" class="attachment-thumbnail" alt="March 2nd" title="March 2nd" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/a-sorry-crop-for-late-february-and-early-march/attachment/day063/' title='March 3rd'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/03/day063-150x150.jpg" class="attachment-thumbnail" alt="March 3rd" title="March 3rd" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/a-sorry-crop-for-late-february-and-early-march/attachment/day064/' title='March 4th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/03/day064-150x150.jpg" class="attachment-thumbnail" alt="March 4th" title="March 4th" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/a-sorry-crop-for-late-february-and-early-march/attachment/day065/' title='March 5th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/03/day065-150x150.jpg" class="attachment-thumbnail" alt="March 5th" title="March 5th" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/a-sorry-crop-for-late-february-and-early-march/attachment/day066/' title='March 6th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/03/day066-150x150.jpg" class="attachment-thumbnail" alt="March 6th" title="March 6th" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/a-sorry-crop-for-late-february-and-early-march/attachment/day067/' title='March 7th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/03/day067-150x150.jpg" class="attachment-thumbnail" alt="March 7th" title="March 7th" /></a>
<a href='http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/a-sorry-crop-for-late-february-and-early-march/attachment/day068/' title='March 8th'><img width="150" height="150" src="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/03/day068-150x150.jpg" class="attachment-thumbnail" alt="March 8th" title="March 8th" /></a>

]]></content:encoded>
			<wfw:commentRss>http://codeandeffect.co.uk/blog/2012/one-self-portrait-a-day-2012/a-sorry-crop-for-late-february-and-early-march/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<enclosure url="http://codeandeffect.co.uk/blog/wp-content/uploads/2012/03/day051-150x150.jpg" length="5476" type="image/jpg" />	</item>
		<item>
		<title>Euler Problem 18 &#8230; and 67</title>
		<link>http://codeandeffect.co.uk/blog/2012/euler-problems/euler-problem-18-and-67/</link>
		<comments>http://codeandeffect.co.uk/blog/2012/euler-problems/euler-problem-18-and-67/#comments</comments>
		<pubDate>Fri, 24 Feb 2012 15:00:36 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Euler Problems]]></category>

		<guid isPermaLink="false">http://codeandeffect.co.uk/blog/?p=1347</guid>
		<description><![CDATA[Euler problem 18 has taken me far longer to conquer than it should have, for the following reasons which I offer here as a guide to others: I aimed low at first I tried to write the &#8216;brute force&#8217; version, &#8230; <a href="http://codeandeffect.co.uk/blog/2012/euler-problems/euler-problem-18-and-67/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Euler <a href="http://projecteuler.net/problem=18" target="_blank">problem 18</a> has taken me far longer to conquer than it should have, for the following reasons which I offer here as a guide to others:</p>
<ol>
<li><strong>I aimed low at first</strong><br />
I tried to write the &#8216;brute force&#8217; version, thinking I&#8217;d learn something along the way and that it would be a good step I could later optimise.<br />
It proved time consuming and didn&#8217;t help me derive my optimal solution.</li>
<li><strong>I took my eyes off the prize</strong><br />
&#8230;and concentrated on reading the tree, and storing routes and visited nodes. I&#8217;d forgotten the question. Using TDD here might&#8217;ve saved me some time.</li>
</ol>
<p>Ditching what I had ans following my instincts, the solution virtually wrote itself. In summary:</p>
<ul>
<li>Start with the bottom 2 rows, and work up. Determine which of the two numbers on the lower row will produce the highest return when added to the single number in the row above.</li>
<li>Use the derived maximum value to overwrite the single number in the upper row.</li>
<li>Repeat until you cannot repeat any more.</li>
</ul>
<p>I was thrilled to see this return very quickly for Problem 18, more so when it was just as fast for Problem 67.</p>
<p>Here&#8217;s my solution, 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:#008000; font-style:italic;"># Project Euler &nbsp;- solution to problems 18 and 67</span><br />
triangles = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span><br />
triangles <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> &nbsp;<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">75</span>,<span style="color:#006666;">95</span>,<span style="color:#006666;">64</span>,<span style="color:#006666;">17</span>,<span style="color:#006666;">47</span>,<span style="color:#006666;">82</span>,<span style="color:#006666;">18</span>,<span style="color:#006666;">35</span>,<span style="color:#006666;">87</span>,<span style="color:#006666;">10</span>,<span style="color:#006666;">20</span>,<span style="color:#006666;">4</span>,<span style="color:#006666;">82</span>,<span style="color:#006666;">47</span>,<span style="color:#006666;">65</span>,<span style="color:#006666;">19</span>,<span style="color:#006666;">1</span>,<span style="color:#006666;">23</span>,<span style="color:#006666;">75</span>,<span style="color:#006666;">3</span>,<span style="color:#006666;">34</span>,<span style="color:#006666;">88</span>,<span style="color:#006666;">2</span>,<span style="color:#006666;">77</span>,<span style="color:#006666;">73</span>,<span style="color:#006666;">7</span>,<span style="color:#006666;">63</span>,<span style="color:#006666;">67</span>,<span style="color:#006666;">99</span>,<span style="color:#006666;">65</span>,<span style="color:#006666;">4</span>,<span style="color:#006666;">28</span>,<span style="color:#006666;">6</span>,<span style="color:#006666;">16</span>,<span style="color:#006666;">70</span>,<span style="color:#006666;">92</span>,<span style="color:#006666;">41</span>,<span style="color:#006666;">41</span>,<span style="color:#006666;">26</span>,<span style="color:#006666;">56</span>,<span style="color:#006666;">83</span>,<span style="color:#006666;">40</span>,<span style="color:#006666;">80</span>,<span style="color:#006666;">70</span>,<span style="color:#006666;">33</span>,<span style="color:#006666;">41</span>,<span style="color:#006666;">48</span>,<span style="color:#006666;">72</span>,<span style="color:#006666;">33</span>,<span style="color:#006666;">47</span>,<span style="color:#006666;">32</span>,<span style="color:#006666;">37</span>,<span style="color:#006666;">16</span>,<span style="color:#006666;">94</span>,<span style="color:#006666;">29</span>,<span style="color:#006666;">53</span>,<span style="color:#006666;">71</span>,<span style="color:#006666;">44</span>,<span style="color:#006666;">65</span>,<span style="color:#006666;">25</span>,<span style="color:#006666;">43</span>,<span style="color:#006666;">91</span>,<span style="color:#006666;">52</span>,<span style="color:#006666;">97</span>,<span style="color:#006666;">51</span>,<span style="color:#006666;">14</span>,<span style="color:#006666;">70</span>,<span style="color:#006666;">11</span>,<span style="color:#006666;">33</span>,<span style="color:#006666;">28</span>,<span style="color:#006666;">77</span>,<span style="color:#006666;">73</span>,<span style="color:#006666;">17</span>,<span style="color:#006666;">78</span>,<span style="color:#006666;">39</span>,<span style="color:#006666;">68</span>,<span style="color:#006666;">17</span>,<span style="color:#006666;">57</span>,<span style="color:#006666;">91</span>,<span style="color:#006666;">71</span>,<span style="color:#006666;">52</span>,<span style="color:#006666;">38</span>,<span style="color:#006666;">17</span>,<span style="color:#006666;">14</span>,<span style="color:#006666;">91</span>,<span style="color:#006666;">43</span>,<span style="color:#006666;">58</span>,<span style="color:#006666;">50</span>,<span style="color:#006666;">27</span>,<span style="color:#006666;">29</span>,<span style="color:#006666;">48</span>,<span style="color:#006666;">63</span>,<span style="color:#006666;">66</span>,<span style="color:#006666;">4</span>,<span style="color:#006666;">68</span>,<span style="color:#006666;">89</span>,<span style="color:#006666;">53</span>,<span style="color:#006666;">67</span>,<span style="color:#006666;">30</span>,<span style="color:#006666;">73</span>,<span style="color:#006666;">16</span>,<span style="color:#006666;">69</span>,<span style="color:#006666;">87</span>,<span style="color:#006666;">40</span>,<span style="color:#006666;">31</span>,<span style="color:#006666;">4</span>,<span style="color:#006666;">62</span>,<span style="color:#006666;">98</span>,<span style="color:#006666;">27</span>,<span style="color:#006666;">23</span>,<span style="color:#006666;">9</span>,<span style="color:#006666;">70</span>,<span style="color:#006666;">98</span>,<span style="color:#006666;">73</span>,<span style="color:#006666;">93</span>,<span style="color:#006666;">38</span>,<span style="color:#006666;">53</span>,<span style="color:#006666;">60</span>,<span style="color:#006666;">4</span>,<span style="color:#006666;">23</span><span style="color:#006600; font-weight:bold;">&#93;</span><br />
<br />
<span style="color:#9966CC; font-weight:bold;">def</span> makeTriangle<span style="color:#006600; font-weight:bold;">&#40;</span>ar<span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; rowCount=<span style="color:#006666;">0</span><br />
&nbsp; &nbsp; <span style="color:#ff6633; font-weight:bold;">$rowsArr</span>=<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span><br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">while</span> ar.<span style="color:#9900CC;">size</span> <span style="color:#006600; font-weight:bold;">&gt;</span> <span style="color:#006666;">0</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#ff6633; font-weight:bold;">$rowsArr</span><span style="color:#006600; font-weight:bold;">&#91;</span>rowCount<span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; reducer = rowCount<span style="color:#006600; font-weight:bold;">+</span><span style="color:#006666;">1</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">while</span> reducer <span style="color:#006600; font-weight:bold;">&gt;</span> <span style="color:#006666;">0</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#ff6633; font-weight:bold;">$rowsArr</span><span style="color:#006600; font-weight:bold;">&#91;</span>rowCount<span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">push</span><span style="color:#006600; font-weight:bold;">&#40;</span>ar.<span style="color:#9900CC;">shift</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;reducer<span style="color:#006600; font-weight:bold;">-</span>=<span style="color:#006666;">1</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; &nbsp; rowCount<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; &nbsp; <span style="color:#ff6633; font-weight:bold;">$rowsArr</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span><br />
<span style="color:#9966CC; font-weight:bold;">def</span> solveTriangle<span style="color:#006600; font-weight:bold;">&#40;</span>triangle<span style="color:#006600; font-weight:bold;">&#41;</span> <br />
numRows = triangle.<span style="color:#9900CC;">length</span><span style="color:#006600; font-weight:bold;">&#40;</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 />
<span style="color:#9966CC; font-weight:bold;">while</span> numRows <span style="color:#006600; font-weight:bold;">&gt;</span> <span style="color:#006666;">0</span><br />
&nbsp; <span style="color:#ff6633; font-weight:bold;">$ar</span>= <span style="color:#CC0066; font-weight:bold;">Array</span>.<span style="color:#9900CC;">new</span><br />
&nbsp; <span style="color:#ff6633; font-weight:bold;">$rowsArr</span><span style="color:#006600; font-weight:bold;">&#91;</span>numRows<span style="color:#006600; font-weight:bold;">-</span><span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">each_index</span><span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">|</span>i<span style="color:#006600; font-weight:bold;">|</span><br />
&nbsp; &nbsp; sumFirstRoute = triangle<span style="color:#006600; font-weight:bold;">&#91;</span>numRows<span style="color:#006600; font-weight:bold;">-</span><span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span>i<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">+</span>triangle<span style="color:#006600; font-weight:bold;">&#91;</span>numRows<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span>i<span style="color:#006600; font-weight:bold;">&#93;</span><br />
&nbsp; &nbsp; sumLastRoute = triangle<span style="color:#006600; font-weight:bold;">&#91;</span>numRows<span style="color:#006600; font-weight:bold;">-</span><span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span>i<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">+</span>triangle<span style="color:#006600; font-weight:bold;">&#91;</span>numRows<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span>i<span style="color:#006600; font-weight:bold;">+</span><span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span><br />
&nbsp; &nbsp; higher = sumFirstRoute<span style="color:#006600; font-weight:bold;">&gt;</span>sumLastRoute &nbsp;? sumFirstRoute : sumLastRoute<br />
&nbsp; &nbsp; triangle<span style="color:#006600; font-weight:bold;">&#91;</span>numRows<span style="color:#006600; font-weight:bold;">-</span><span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span>i<span style="color:#006600; font-weight:bold;">&#93;</span>= &nbsp;higher<br />
&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><br />
&nbsp; numRows<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 />
triangle<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span><br />
triangles.<span style="color:#9900CC;">each</span><span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">|</span>tri<span style="color:#006600; font-weight:bold;">|</span> <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Max attainable value from triangle<span style="color:#000099;">\:</span> #{solveTriangle( makeTriangle(tri))}&quot;</span><span style="color:#006600; font-weight:bold;">&#125;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://codeandeffect.co.uk/blog/2012/euler-problems/euler-problem-18-and-67/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>
	</channel>
</rss>

