<?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>Lynxworks &#187; Dougie</title>
	<atom:link href="http://blog.lynxworks.eu/author/dougie/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.lynxworks.eu</link>
	<description>I don&#039;t think there are any dragons here</description>
	<lastBuildDate>Sat, 31 Mar 2012 12:42:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>A quick thank you</title>
		<link>http://blog.lynxworks.eu/2012/03/packaging/</link>
		<comments>http://blog.lynxworks.eu/2012/03/packaging/#comments</comments>
		<pubDate>Sun, 18 Mar 2012 19:34:00 +0000</pubDate>
		<dc:creator>Dougie</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[CAS]]></category>
		<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[Maxima]]></category>
		<category><![CDATA[Packaging]]></category>
		<category><![CDATA[Planet Ubuntu]]></category>
		<category><![CDATA[Thanks]]></category>

		<guid isPermaLink="false">http://blog.lynxworks.eu/?p=2246</guid>
		<description><![CDATA[I needed wxMaxima but the version in the repositories is a little older (one major revision). Compiling from source is straightforward but a recent discussion I had with students showed they shied away from it. So I figured I&#8217;d try &#8230; <a href="http://blog.lynxworks.eu/2012/03/packaging/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I needed <a href="http://andrejv.github.com/wxmaxima/">wxMaxima</a> but the version in the repositories is a little older (one major revision). Compiling from source is straightforward but a recent discussion I had with students showed they shied away from it.</p>
<p>So I figured I&#8217;d try packaging and a couple of hours later and I&#8217;ve a copy in my PPA. I&#8217;m unsure who maintains the <a href="https://wiki.ubuntu.com/PackagingGuide/Complete">packaging guide</a> so I wanted to say thank you on Ubuntu Planet hoping those involved see it. Its great when you want to try something, find comprehensive instructions and can wrap it up in a few hours.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lynxworks.eu/2012/03/packaging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Normal service will continue&#8230;</title>
		<link>http://blog.lynxworks.eu/2012/03/normal-service-will-continue/</link>
		<comments>http://blog.lynxworks.eu/2012/03/normal-service-will-continue/#comments</comments>
		<pubDate>Sat, 03 Mar 2012 18:41:02 +0000</pubDate>
		<dc:creator>Dougie</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Comics]]></category>

		<guid isPermaLink="false">http://blog.lynxworks.eu/?p=2219</guid>
		<description><![CDATA[For seven months in 2011 I had a regular treat &#8211; a volume of &#8220;Judge Dredd: Complete Case Files&#8221;. From January through July, I was re-reading my favourite childhood comic &#8211; Apocalypse Wars, Block Mania, Judge Child Quest and the fantastic &#8230; <a href="http://blog.lynxworks.eu/2012/03/normal-service-will-continue/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>For seven months in 2011 I had a regular treat &#8211; a volume of &#8220;Judge Dredd: Complete Case Files&#8221;. From January through July, I was re-reading my favourite childhood comic &#8211; Apocalypse Wars, Block Mania, Judge Child Quest and the fantastic Day the Law Died. Best of all I could introduce my kids to something besides Marvel and DC (although I did wonder about my daughter&#8217;s acceptance of infallible law). Then it stopped &#8211; volume 8 was no where to be seen. Couldn&#8217;t find it anywhere and my obsessive nature meant I wouldn&#8217;t bypass it.</p>
<p>I just got an email from Amazon &#8211; &#8220;<a href="http://www.amazon.co.uk/gp/product/1905437277/ref=oh_o00_s00_i00_details">Judge Dredd: Complete Case Files &#8211; Volume 8</a>&#8220;, order dispatched.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lynxworks.eu/2012/03/normal-service-will-continue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Small steps</title>
		<link>http://blog.lynxworks.eu/2012/02/small-steps/</link>
		<comments>http://blog.lynxworks.eu/2012/02/small-steps/#comments</comments>
		<pubDate>Thu, 23 Feb 2012 19:11:01 +0000</pubDate>
		<dc:creator>Dougie</dc:creator>
				<category><![CDATA[Open University]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Running]]></category>
		<category><![CDATA[MS221]]></category>
		<category><![CDATA[MT264]]></category>
		<category><![CDATA[TT284]]></category>

		<guid isPermaLink="false">http://blog.lynxworks.eu/?p=2198</guid>
		<description><![CDATA[Back in October I started to develop some serious shin pain and began the Army&#8217;s rehabilitation process. A better process than people give credit for &#8211; put in effort, take it seriously and it has results. It just takes time. Today &#8230; <a href="http://blog.lynxworks.eu/2012/02/small-steps/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Back in October I started to develop some serious shin pain and began the Army&#8217;s rehabilitation process. A better process than people give credit for &#8211; put in effort, take it seriously and it has results. It just takes time. Today I got upgraded to a run/walk program &#8211; as long as I remain pain free I could be running in three weeks. I&#8217;ve missed doing a few miles after work.</p>
<p>Speaking of small steps, that&#8217;s how MS221 TMA 2 feels. I enjoyed Chapter B3 (eigenvalues) but there&#8217;s only one question on it. Iteration is half the paper! I&#8217;ve still to catch up with block C!</p>
<p>MT264 TMA 3 is due at the start of March &#8211; so I think I&#8217;ve another week where I&#8217;ve time only to train, study and sleep.</p>
<p>Thankfully I&#8217;m a couple of weeks ahead on TT284. I&#8217;ve kept off the PlayStation but MW3&#8242;s first map pack is out at the end of the month.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lynxworks.eu/2012/02/small-steps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Invisible posts and the same complaints</title>
		<link>http://blog.lynxworks.eu/2012/02/invisible-posts-and-the-same-complaints/</link>
		<comments>http://blog.lynxworks.eu/2012/02/invisible-posts-and-the-same-complaints/#comments</comments>
		<pubDate>Sun, 19 Feb 2012 13:01:11 +0000</pubDate>
		<dc:creator>Dougie</dc:creator>
				<category><![CDATA[Open University]]></category>
		<category><![CDATA[Forum]]></category>
		<category><![CDATA[TT284]]></category>

		<guid isPermaLink="false">http://blog.lynxworks.eu/?p=2189</guid>
		<description><![CDATA[I&#8217;m sure my posts on TT284-12B are invisible. Someone asks a question, I post an answer then three others post the same answer shortly before the asker thanks them. Sounds petty, I know, but I&#8217;m genuinely wondering if my posts are &#8230; <a href="http://blog.lynxworks.eu/2012/02/invisible-posts-and-the-same-complaints/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m sure my posts on TT284-12B are invisible. Someone asks a question, I post an answer then three others post the same answer shortly before the asker thanks <em>them</em>. Sounds petty, I know, but I&#8217;m genuinely wondering if my posts are visible.</p>
<p>I&#8217;m tired of seeing the same complaints too. You might well argue that if people keep complaining there&#8217;s a genuine issue and there is &#8211; <em>people don&#8217;t read the damn module descriptions</em>. If the module description says the material is entirely presented on-line (which it does) then you&#8217;re on a hiding to nothing to complain you didn&#8217;t get a book.</p>
<p>University should be somewhere to meet people with similar interests, share ideas and see things from new perspectives. Perhaps its because I&#8217;ve been moderating a module that I&#8217;ve become jaded. I&#8217;m becoming less and less interested in interacting with other students.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lynxworks.eu/2012/02/invisible-posts-and-the-same-complaints/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Screen-grab Kindle</title>
		<link>http://blog.lynxworks.eu/2012/02/screen-grab-kindle/</link>
		<comments>http://blog.lynxworks.eu/2012/02/screen-grab-kindle/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 20:27:26 +0000</pubDate>
		<dc:creator>Dougie</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[Kindle]]></category>

		<guid isPermaLink="false">http://blog.lynxworks.eu/?p=2176</guid>
		<description><![CDATA[Kindle 3 -↑+Alt+G (Shift, Alt and G together). That is all.]]></description>
			<content:encoded><![CDATA[<p>Kindle 3 -↑+Alt+G (Shift, Alt and G together).</p>
<p><a style="color: #ff4b33; line-height: 24px;" href="http://blog.lynxworks.eu/wp-content/uploads/2012/02/screen_shot-18312.gif"><img class="alignnone size-medium wp-image-2177" style="border-style: initial; border-color: initial;" title="screen_shot-18312" src="http://blog.lynxworks.eu/wp-content/uploads/2012/02/screen_shot-18312-225x300.gif" alt="" width="225" height="300" /></a></p>
<p>That is all.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lynxworks.eu/2012/02/screen-grab-kindle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tomighty</title>
		<link>http://blog.lynxworks.eu/2012/02/tomighty/</link>
		<comments>http://blog.lynxworks.eu/2012/02/tomighty/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 14:54:18 +0000</pubDate>
		<dc:creator>Dougie</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[Open University]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Study]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://blog.lynxworks.eu/?p=2173</guid>
		<description><![CDATA[If you&#8217;re a fan of the Pomodoro technique &#8211; there&#8217;s a fantastic little timer applet for the notification area called Tomighty.]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re a fan of the <a href="http://www.pomodorotechnique.com/">Pomodoro</a> technique &#8211; there&#8217;s a fantastic little timer applet for the notification area called <a href="http://www.tomighty.org">Tomighty</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lynxworks.eu/2012/02/tomighty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>If</title>
		<link>http://blog.lynxworks.eu/2012/02/if/</link>
		<comments>http://blog.lynxworks.eu/2012/02/if/#comments</comments>
		<pubDate>Sat, 04 Feb 2012 10:26:50 +0000</pubDate>
		<dc:creator>Dougie</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://blog.lynxworks.eu/?p=2162</guid>
		<description><![CDATA[If you can keep your head when all about you Are losing theirs and blaming it on you, If you can trust yourself when all men doubt you, But make allowance for their doubting too; If you can wait and &#8230; <a href="http://blog.lynxworks.eu/2012/02/if/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<blockquote><p>If you can keep your head when all about you<br />
Are losing theirs and blaming it on you,<br />
If you can trust yourself when all men doubt you,<br />
But make allowance for their doubting too;<br />
If you can wait and not be tired by waiting,<br />
Or being lied about, don&#8217;t deal in lies,<br />
Or being hated, don&#8217;t give way to hating,<br />
And yet don&#8217;t look too good, nor talk too wise:</p>
<p>If you can dream &#8211; and not make dreams your master;<br />
If you can think &#8211; and not make thoughts your aim;<br />
If you can meet with Triumph and Disaster<br />
And treat those two impostors just the same;<br />
If you can bear to hear the truth you&#8217;ve spoken<br />
Twisted by knaves to make a trap for fools,<br />
Or watch the things you gave your life to, broken,<br />
And stoop and build &#8216;em up with worn-out tools:</p>
<p>If you can make one heap of all your winnings<br />
And risk it on one turn of pitch-and-toss,<br />
And lose, and start again at your beginnings<br />
And never breathe a word about your loss;<br />
If you can force your heart and nerve and sinew<br />
To serve your turn long after they are gone,<br />
And so hold on when there is nothing in you<br />
Except the Will which says to them: &#8216;Hold on!&#8217;</p>
<p>If you can talk with crowds and keep your virtue,<br />
Or walk with Kings &#8211; nor lose the common touch,<br />
If neither foes nor loving friends can hurt you,<br />
If all men count with you, but none too much;<br />
If you can fill the unforgiving minute<br />
With sixty seconds&#8217; worth of distance run,<br />
Yours is the Earth and everything that&#8217;s in it,<br />
And &#8211; which is more &#8211; you&#8217;ll be a Man, my son!</p>
<p style="text-align: right;">- Rudyard Kipling, &#8220;If&#8221; (1895)</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.lynxworks.eu/2012/02/if/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Keeping resolutions</title>
		<link>http://blog.lynxworks.eu/2012/01/keeping-resolutions/</link>
		<comments>http://blog.lynxworks.eu/2012/01/keeping-resolutions/#comments</comments>
		<pubDate>Sun, 15 Jan 2012 02:11:03 +0000</pubDate>
		<dc:creator>Dougie</dc:creator>
				<category><![CDATA[Open University]]></category>
		<category><![CDATA[Psychology]]></category>
		<category><![CDATA[Rant]]></category>
		<category><![CDATA[Rants]]></category>
		<category><![CDATA[Resolutions]]></category>

		<guid isPermaLink="false">http://blog.lynxworks.eu/?p=2131</guid>
		<description><![CDATA[Have I? Yes and no. Studying is a yes. I found that the 45/15 method is working well, allowing me to do MS221 and MT264 (the latter has a TMA due next week). I might have to extend this &#8211; &#8230; <a href="http://blog.lynxworks.eu/2012/01/keeping-resolutions/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Have I? Yes and no.</p>
<p><span id="more-2131"></span>Studying is a yes. I found that the 45/15 method is working well, allowing me to do MS221 and MT264 (the latter has a TMA due next week). I might have to extend this &#8211; I want to really have a good grasp of MS221.</p>
<p>Exercise is a no. I had assumed that attending PT (Monday, Wednesday, Friday), rehab lessons (Tuesday and twice on Thursday) would mean I only had to make an effort to do my own fitness at the weekends. However I had a meetings on Tuesday and Wednesday which completely got in the way. I&#8217;m going to start using Daily Mile again next week to give me an incentive. Rehab was an absolute killer on Thursday, my calves are still aching on Saturday. As for diet, I ate a load of crap tonight but mostly managed to stick to three light meals each day. I&#8217;ve been getting up a little earlier and making breakfast. This has worked out quite well because I&#8217;m not fighting with the kids to get into the bathroom &#8211; its been a better start to the day.</p>
<p>Money has been the usual post Christmas study but Lisa has picked up some baby-sitting which has allowed me to grocery shop this week without touching the money in the bank. Its a long way to my £3000 goal but its certainly been a welcome start.</p>
<p>The reading has been pretty respectable &#8211; I&#8217;ve finished &#8220;The Art of Readable Code&#8221; (an interesting look at improving the way we lay out code), Mastering Microsoft Visual Basic 2010 (which was a lot less dry than these books usually are) and &#8220;The Moon is a Harsh Mistress&#8221; (not as attention holding as Starship Troopers but very good). I&#8217;ll start &#8220;Stranger in a Strange Land&#8221; this week.</p>
<p>Simplifying has proved a bigger task than I envisaged. I gave a way a lot of clothes, so was able to lay out my wardrobe with hanging shelves. Now my clothes are organised, its a two minute job to grab what I need for the gym and the next day at work. I cleared out and re-organised my kit cupboard, the next step for that is to get some of the obsolete stuff de-kitted. I picked up some rattan organising drawers (£5 on a local buy and sell site) which has helped Lisa by me not leaving everything down the side of the sofa. Next week I&#8217;d like to grab some archive boxes and store away OU material from completed modules.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lynxworks.eu/2012/01/keeping-resolutions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Resolution</title>
		<link>http://blog.lynxworks.eu/2012/01/resolution/</link>
		<comments>http://blog.lynxworks.eu/2012/01/resolution/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 03:46:36 +0000</pubDate>
		<dc:creator>Dougie</dc:creator>
				<category><![CDATA[Open University]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Running]]></category>
		<category><![CDATA[Resolutions]]></category>

		<guid isPermaLink="false">http://blog.lynxworks.eu/?p=2045</guid>
		<description><![CDATA[Another year draws to a close and I thought I might post some resolutions &#8211; perhaps making them public will help me meet them. The Happiness Project suggests that its a good idea to realise the difference between resolutions and goals. Exercise Since &#8230; <a href="http://blog.lynxworks.eu/2012/01/resolution/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Another year draws to a close and I thought I might post some resolutions &#8211; perhaps making them public will help me meet them. <span style="line-height: 24px;">The </span><a style="line-height: 24px;" href="http://www.happiness-project.com/happiness_project/2008/04/happiness-shoul.html">Happiness Project</a><span style="line-height: 24px;"> suggests that its a good idea to realise the difference between resolutions and goals.</span><br />
<span id="more-2045"></span></p>
<h2>Exercise</h2>
<p>Since coming back from tour last year I developed an injury. After several months of rehab, I&#8217;ve gained weight and lost fitness.</p>
<p>Resolution &#8211; exercise every day, adhering to a program. Goals &#8211; to pass a PFT/CFT and to get back under 90 kg.</p>
<h2>Study</h2>
<p>As I approach the halfway mark in my degree, I realised that I&#8217;ve done most of my assessments in last minute panic. Aside from being stressful, its not a good way to learn.</p>
<p>Resolution &#8211; to study a couple of hours each day, adhering to a study plan. Goals &#8211; to complete three modules with a good pass.</p>
<h2>Money</h2>
<p>Having spent a lot of last year living hand to mouth and the economy being in the toilet, I&#8217;d like to reduce my outgoings and have some savings.</p>
<p>Resolution &#8211; reduce outgoings and start saving. Goal &#8211; £3000 in savings.</p>
<h2>Personal</h2>
<p>There&#8217;s a lot of books I really want to read. I&#8217;m going to expand on this in another post but I want to get through one a week, especially some of the books on programming and mathematics I have bought but not yet got round to.</p>
<p>Resolutions &#8211; read more. Goals &#8211; to complete the list of books in this <a href="http://blog.lynxworks.eu/2012/01/books/">post</a>.</p>
<h2>Simplify</h2>
<p>I have a lot of stuff and if I&#8217;m honest, I don&#8217;t need a lot of it. There&#8217;s a good chance that I can make a portion of my savings goal above it I sell stuff I don&#8217;t need. I can give a way a lot of stuff too &#8211; how many clothes do we really need? I spend half my life in uniform, a huge chunk in running gear and the rest mostly in sweats.</p>
<p>Resolution - de-clutter. Goals &#8211; this is difficult to quantify but it would be good to have an empty garage.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lynxworks.eu/2012/01/resolution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Forget everything you knew about coding (or perhaps remember, depending on your age)</title>
		<link>http://blog.lynxworks.eu/2011/12/forget-everything-you-knew-about-coding-or-perhaps-remember-depending-on-your-age/</link>
		<comments>http://blog.lynxworks.eu/2011/12/forget-everything-you-knew-about-coding-or-perhaps-remember-depending-on-your-age/#comments</comments>
		<pubDate>Sun, 25 Dec 2011 20:34:06 +0000</pubDate>
		<dc:creator>Dougie</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[COBOL]]></category>
		<category><![CDATA[Planet Ubuntu]]></category>
		<category><![CDATA[Project Euler]]></category>

		<guid isPermaLink="false">http://blog.lynxworks.eu/?p=2037</guid>
		<description><![CDATA[This Christmas I&#8217;m going to embrace the past. COmmon Business Oriented Language (COBOL) 85 standard was the first language I was taught. Napier University was a feeder into the banking and insurance industries in Edinburgh at the time and they &#8230; <a href="http://blog.lynxworks.eu/2011/12/forget-everything-you-knew-about-coding-or-perhaps-remember-depending-on-your-age/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This Christmas I&#8217;m going to embrace the past.</p>
<p>COmmon Business Oriented Language (COBOL) 85 standard was the first language I was taught. Napier University was a feeder into the banking and insurance industries in Edinburgh at the time and they had sizeable COBOL farms. It proved profitable too, as a number of students I knew went to the US to alleviate Y2K bugs in thousands of legacy applications. COBOL had fallen out of favour in US colleges.</p>
<p><span id="more-2037"></span>I was talking to someone the other day who mentioned that he maintains COBOL legacy applications. Apparently things have gone full circle for the UK, where COBOL is no longer taught so his company outsources to India. I&#8217;m not overly surprised COBOL is dying out as an educational tool because as languages go its not like much else &#8211; Dijkstra certainly didn&#8217;t <a href="http://www.cs.utexas.edu/users/EWD/transcriptions/EWD04xx/EWD498.html">rate it</a>:</p>
<blockquote><p>The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offence.</p></blockquote>
<p>Who am I to argue with the man who <a href="http://www.cs.utexas.edu/users/EWD/transcriptions/EWD02xx/EWD215.html">killed the</a> <em>goto</em> statement? Certainly as a language it has issues &#8211; the 86 standard wasn&#8217;t totally compatible with the previous 74 standard; it has no functions; and it has no pointers. Then again it was in part based around the work of <a href="http://en.wikipedia.org/wiki/Grace_Hopper">Rear Admiral Grace Hopper</a>, the coolest woman ever in computer science, so it couldn&#8217;t be all bad could it? She believed that programming languages in mathematical notation were generally not well understood &#8211; COBOL is about as self documenting as it gets. It is a product of its time &#8211; for example the first six columns are reserved for sequence numbers, this came about as forms were used to write programs which were in turn converted to punch cards.</p>
<p>An example is the best way to explain this, so I decided to <a title="Find the sum of all the multiples of 3 or 5 below 1000" href="http://blog.lynxworks.eu/2011/06/find-the-sum-of-all-the-multiples-of-3-or-5-below-1000/">revisit</a> Project Euler&#8217;s first problem and code it in COBOL, something I haven&#8217;t touched in <em>years</em>. As Rear Admiral Grace Hopper said:</p>
<blockquote><p>It&#8217;s easier to ask for forgiveness than it is to get permission.</p></blockquote>
<p>Of course we need a compiler, Ubuntu has <a href="http://www.opencobol.org/">Open COBOL</a> available:</p>
<pre class="brush: bash; gutter: true">sudo apt-get install open-cobol</pre>
<p>Lets consider the problem again:</p>
<blockquote><p>If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.</p>
<p>Find the sum of all the multiples of 3 or 5 below 1000.</p></blockquote>
<p>My solution is to iterate through every number from 1 to 1000, test if it divides by 3 or 5 without a remainder and if so then add it to a counter. In pseudocode:</p>
<pre class="brush: text; gutter: true">For counter = 1 to 1000 Step 1
    If counter % 3 = 0 or number % 5 = 0 Then
        total = total + counter
    End If
End For
Display total</pre>
<p>But wait &#8211; this is COBOL, a language that doesn&#8217;t include the word &#8220;terse&#8221;. So let&#8217;s adapt this to a more verbose piece of pseudocode:</p>
<pre class="brush: text; gutter: true">For counter = 1 To 1000
    If counter % 3 = 0 Then
        Set flag To TRUE
    End If
    If counter % 5 = 0 Then
        Set flag To TRUE
    End If
    If flag = TRUE Then
        total = total + counter
        Set flag To FALSE
    End If
    Display total
End For</pre>
<p>Right, here we go. Its been a <em>long time</em>.  COBOL is organised into divisions, sections, paragraphs, sentences and statements &#8211; all are terminated by a period. There are four divisions:</p>
<ul>
<li>Identification. Unsurprisingly contains information about the program.</li>
<li>Environment. This isn&#8217;t initially obvious but is concerned with portability &#8211; this section allows you to isolate anything that is platform specific. So in theory only the environment division needs changing between platforms.</li>
<li>Data. This holds all the variables and has four sections &#8211; file (file handling); linkage (used with sub-routines); report (for report writers); and the one you almost always need, working-storage (where all your working variables are).</li>
<li>Procedure. Guess what? Yes this is where the program itself is.</li>
</ul>
<div><span style="font-size: small;"><span style="line-height: 24px;">Let&#8217;s start with the beginning:</span></span></div>
<pre class="brush: text; gutter: true">        IDENTIFICATION DIVISION.
        PROGRAM-ID. EULER_PROBLEM_ONE.</pre>
<p>Not much explanation required there then. We don&#8217;t need an environment division, it doesn&#8217;t hurt to populate the division name anyway.</p>
<p>The next division requires a little more explanation. We need a working-storage section but COBOL defines variables using level, name, picture clause and optionally a value.</p>
<p>Picture clauses define a variable&#8217;s format. Levels allow data to be grouped, for example if you defined a student as having an ID and a name you might have:</p>
<pre class="brush: text; gutter: true">01 student.
    02 identifier          PIC A9(7).
    02 name                PIC A(30).</pre>
<p>Level numbers are for the most part arbitrary as long as the lower the number the higher the level, with the exception of 66 (deprecated), 77 (individual elements) and 88 (used to define conditions). Picture clauses can use: 9 (digit); A (letter); X (digit or letter); V (decimal point); S (sign). You can use A(30) rather than typing loads of A&#8217;s.</p>
<p>That just leaves us a procedure division. If you have ever coded assembler then you&#8217;ll probably find this easier than if you&#8217;ve used C. You need to describe every step. The main iteration construct we need from our pseudocode is a For Loop. COBOL has a PERFORM statement, you need to increment your counter yourself:</p>
<pre class="brush: text; gutter: true">PERFORM UNTIL counter = 3
    ADD 1 TO counter GIVING counter
END-PERFORM.</pre>
<p>A general convention is to use upper-case for reserved words and lower-case for variables. Pretty much all operations follow this command&#8217;s format &#8211; do something (ADD 1) to something (counter) and store it somewhere (counter).</p>
<pre class="brush: text; gutter: true">IF condition1 &gt; condition2 THEN
   STATEMENT
ELSE
   STATEMENT
END-IF.</pre>
<p>You can nest if statements (there&#8217;s no Else If statement). Its not uncommon to find a lot of legacy code that only uses IF statements, why I don&#8217;t know because it has a Case statement called EVALUATE.</p>
<p>That just leaves us assignment:</p>
<pre class="brush: text; gutter: true">MOVE value TO variable</pre>
<p>Putting it all together, you need variables to Hold temporary values used to calculate answers, I always call it <em>junk</em>:</p>
<pre class="brush: text; gutter: true">        IDENTIFICATION DIVISION.
        PROGRAM-ID. EULER_PROBLEM_ONE.

        ENVIRONMENT DIVISION.

        DATA DIVISION.
        WORKING-STORAGE SECTION.
        01 total        PIC 999999     VALUE 0.
        01 counter      PIC 9999       VALUE 1.
        01 junk         PIC 999999     VALUE 0.
        01 flag         PIC 9          VALUE 0.

        PROCEDURE DIVISION.
        PERFORM UNTIL counter = 1000
             COMPUTE junk = FUNCTION MOD (counter, 3)
             IF junk = 0 THEN
                 MOVE 1 TO flag
             END-IF
             COMPUTE junk = FUNCTION MOD (counter, 5)
             IF junk = 0 THEN
                MOVE 1 TO flag
             END-IF
             IF flag = 1 THEN
                ADD counter TO total GIVING total
                MOVE 0 TO flag
             END-IF
             ADD 1 TO counter GIVING counter
        END-PERFORM.
        DISPLAY total.
        STOP RUN.</pre>
<p>Remember that indentation is important (despite the code formatting here not wanting to do it) &#8211; areas A and B take the first 6 characters so you need to begin in column 7.</p>
<p>Save the file as euler.cob, compile and run it:</p>
<pre class="brush: bash; gutter: true">cobc -x euler.cob
./euler</pre>
<p>Giving the correct answer of 233168, albeit without any frills.</p>
<div id="attachment_2059" class="wp-caption alignnone" style="width: 291px"><a href="http://blog.lynxworks.eu/wp-content/uploads/2011/12/Capture.png"><img class="size-full wp-image-2059" title="Hold on to your hats..." src="http://blog.lynxworks.eu/wp-content/uploads/2011/12/Capture.png" alt="Output" width="281" height="106" /></a><p class="wp-caption-text">Hold on to your hats...</p></div>
<p>It took me a while to get this to compile &#8211; <a href="http://www.opencobol.org/">Open COBOL</a> doesn&#8217;t care for the AUTHOR statement in the IDENTIFICATION DIVISION so I removed it.</p>
<p>What this snippet of code doesn&#8217;t show us is that larger projects are unbelievably verbose, lines and lines of code. Nor does it cover the hilarity of design using <a href="http://en.wikipedia.org/wiki/Data_flow_diagram">Data Flow Diagrams</a> - queuing for hours to collect printouts from the University&#8217;s only <a href="http://en.wikipedia.org/wiki/Dot_matrix_printer">132 column</a> printer.</p>
<p>Well that&#8217;s been a fun trip down memory lane, I don&#8217;t remember why I started this post.</p>
<p>Now get off my lawn.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lynxworks.eu/2011/12/forget-everything-you-knew-about-coding-or-perhaps-remember-depending-on-your-age/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

