<?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>Conor's Blog</title>
	<atom:link href="http://blog.macaoidh.name/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.macaoidh.name</link>
	<description>PHP, Music, Linux</description>
	<lastBuildDate>Mon, 05 Jul 2010 13:25:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Furasta.Org 1.0 Beta &#8211; 1st August</title>
		<link>http://blog.macaoidh.name/2010/07/05/furasta-org-1-0-beta-1st-august/</link>
		<comments>http://blog.macaoidh.name/2010/07/05/furasta-org-1-0-beta-1st-august/#comments</comments>
		<pubDate>Mon, 05 Jul 2010 13:25:40 +0000</pubDate>
		<dc:creator>Conor</dc:creator>
				<category><![CDATA[Furasta.Org]]></category>
		<category><![CDATA[1st August 2010]]></category>
		<category><![CDATA[beta]]></category>
		<category><![CDATA[furasta org]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[repository]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://blog.macaoidh.name/?p=322</guid>
		<description><![CDATA[Furasta.Org version 1.0 Beta will be released on 1st August 2010. What will be in this beta? Almost everything required to run a website. The Beta is merely a formality to allow for unforeseen bug fixes. I had planned to do so much with Furasta.Org, but I have been forced to narrow it down to [...]]]></description>
			<content:encoded><![CDATA[<p>Furasta.Org version 1.0 Beta will be released on 1st August 2010. What will be in this beta? Almost everything required to run a website. The Beta is merely a formality to allow for unforeseen bug fixes.</p>
<p>I had planned to do so much with Furasta.Org, but I have been forced to narrow it down to a small list of features. Additional features will be added through the plugin architecture, and in time to the main CMS.</p>
<ul>
<li>Editing Pages &#8211; the most obvious and fundamental feature, but I have added a few thing to this that I haven&#8217;t seen elsewhere.</li>
<li>Users and Permissions &#8211; It will be possible to set who can view certain pages, and even who can edit them. In the future I hope to expand on this section with User Groups, though they will not be included in this release.</li>
<li>Website Configuration &#8211; General settings, also including some new ideas I haven&#8217;t seen anywhere.</li>
<li>Template Management &#8211; Set what template or theme to use for the website&#8217;s appearance. Though not in this release, I hope to add an online template repository which one can browse from the CMS admin panel.</li>
<li>Plugin Architecture &#8211; One of the largest and most important features of the whole system. This complex architecture will allow other developers to use Furasta.Org to their advantage. Through the use of a &#8220;hook&#8221; system, vaguely similar to wordpress&#8217;s, I hope to offer the developer total control over almost every part of the CMS. In the future I also plan to add a plugin repository to the website, which will include verified, safe plugins and which will be installable from the admin panel.</li>
<li>Upgrade Manager &#8211; Regardless of what I have said so far; this is the most important feature. I was of two minds as to including this feature so soon, but I decided that If this was enabled then systmes would be updated smoothly along with new releases.</li>
</ul>
<p>So there&#8217;s a lot in store &#8211; and the first website running the CMS will be Furasta.Org &#8211; live on the 1st August 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.macaoidh.name/2010/07/05/furasta-org-1-0-beta-1st-august/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OS X: Audio Alerts for PHP Errors</title>
		<link>http://blog.macaoidh.name/2010/06/22/os-x-audio-alerts-for-php-errors/</link>
		<comments>http://blog.macaoidh.name/2010/06/22/os-x-audio-alerts-for-php-errors/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 16:14:41 +0000</pubDate>
		<dc:creator>Conor</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Apple Script]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.macaoidh.name/?p=312</guid>
		<description><![CDATA[Kae posted today about tackling this problem under Linux, but I&#8217;ve found that it&#8217;s quite a different task under OS X. Anyway here is how it&#8217;s done: First you need to download the swatch package from here. If you haven&#8217;t done it before you will have to set up cpan and it&#8217;s a lengthy process. [...]]]></description>
			<content:encoded><![CDATA[<p>Kae <a href="http://verens.com/2010/06/22/audio-alerts-for-php-errors">posted</a> today about tackling this problem under Linux, but I&#8217;ve found that it&#8217;s quite a different task under OS X. Anyway here is how it&#8217;s done:</p>
<p>First you need to download the swatch package from <a href="http://sourceforge.net/projects/swatch/">here</a>.</p>
<p>If you haven&#8217;t done it before you will have to set up cpan and it&#8217;s a lengthy process. Run cpan in the terminal. It&#8217;s safe to say yes to all the options. Once it&#8217;s installed you need to add some perl modules. In the cpan prompt add the following modules:</p>
<pre class="brush:bash">install Date::Calc
install Date::Format
install Date::Manip
install File::Tail
</pre>
<p>That&#8217;s the perl part finished anyway. Now change to the swatch directory and compile:</p>
<pre class="brush:bash">perl Makefile.pl
make
make install</pre>
<p>Ok swatch should be installed now. So set up the configuration file: <code>vim ~/.swatchrc</code> Add the following lines to the file:</p>
<pre class="brush:bash">watchfor /PHP Parse error|PHP Fatal error/
bell 3
</pre>
<p>Save and return to the command line. Now to add swatch (and also optionally apache and mysql) as a startup item do as follows. Create a new directory named StartUpItems, then create the following files so your setup should look like this:</p>
<pre>StartUpItems
StartUpItems/StartUpItems (a file with no extention)
StartUpItems/StartupParameters.plist
</pre>
<p>Now add the following contents to StartupParameters.plist:</p>
<pre class="brush:xml">
< ?xml version="1.0" encoding="UTF-8"?>
< !DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
    <dict>
        <key>Description</key>
        <string>Various Startup commands including Swatch, Apache and MySQL.</string>

        <key>OrderPreference</key>
        <string>Late</string>

        <key>Provides</key>
        <array>
                <string>Starts up Swatch, Apache and MySQL.</string>
        </array>
    </dict>
</plist>
</pre>
<p>That&#8217;s just a file required by OS X to recognise the startup item, don&#8217;t worry to much about it. Now to the StartUpCommands file which is a bash script:</p>
<pre class="brush:bash">#!/bin/bash
. /etc/rc.common

StartService(){
        ConsoleMessage "Starting Apache, MySQL and Swatch"
        apachectl start
        /usr/local/mysql/support-files/mysql.server start
        /opt/local/bin/swatch --daemon --config-file=/Users/conormacaoidh/.swatchrc --tail-file=/var/log/php/php-error_log --pid-file=/var/run/swatch-httpd-errors.pid
}

StopService(){
        ConsoleMessage "Stopping Apache, MySQL and Swatch"
        PID=`cat /var/run/swatch-httpd-errors.pid`
        kill -9 $PID
        apachectl stop
        /usr/local/mysql/support-files/mysql.server stop
}

RestartService(){
        RunService stop
        RunService start
}

RunService "$1"
</pre>
<p>The file</p>
<pre>/etc/rc.common</pre>
<p>is provided by apple and makes the process a lot easier, though it is not needed. The lines in StartService and StopService do the opposite of each other but are very similar. You may need to change the apache and mysql start/stop commands according to your own setup. If you are using MAMP this file will start apache and mysql:</p>
<pre>/Applications/MAMP/bin/start.sh</pre>
<p>As for the swatch line you will obviously have to change the config file location and the php error log location to what&#8217;s appropriate on your machine.</p>
<p>And that&#8217;s it really. Then copy the items to the correct directory for OS X to recognise them:</p>
<pre class="brush:bash">sudo cp -R StartUpCommands /Library/StartUpItems
</pre>
<p>It is vital that you change the permissions or else the startup item simply won&#8217;t be executed:</p>
<pre class="brush:bash">sudo chown -R root /Library/StartUpItems/StartUpCommands
sudo chgrp -R wheel /Library/StartUpItems/StartUpCommands
sudo chmod -R 755 /Library/StartUpItems/StartUpCommands
</pre>
<p>That&#8217;s it. You can test the configuration by running SystemStarter -n -D which will emulate what happens when the computer starts, it is useful for de-bugging.</p>
<p>So restart you computer, load a php file with an error in it and your machine will beep thrice!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.macaoidh.name/2010/06/22/os-x-audio-alerts-for-php-errors/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Finally Finished</title>
		<link>http://blog.macaoidh.name/2010/06/21/finally-finished/</link>
		<comments>http://blog.macaoidh.name/2010/06/21/finally-finished/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 12:34:25 +0000</pubDate>
		<dc:creator>Conor</dc:creator>
				<category><![CDATA[School]]></category>
		<category><![CDATA[finished school]]></category>
		<category><![CDATA[trainspotting]]></category>
		<category><![CDATA[ucd]]></category>

		<guid isPermaLink="false">http://blog.macaoidh.name/?p=308</guid>
		<description><![CDATA[Today I sat my last Leaving Cert exam, Physics. I never have to go to school again&#8230; a feeling so good it&#8217;s impossible to put into words! I now finally have time to do what I want and enjoy the little things in life, like programming! I can&#8217;t wait to get started again.. Anyway I [...]]]></description>
			<content:encoded><![CDATA[<p>Today I sat my last Leaving Cert exam, Physics. I never have to go to school again&#8230; a feeling so good it&#8217;s impossible to put into words! I now finally have time to do what I want and enjoy the little things in life, like programming! I can&#8217;t wait to get started again..</p>
<p>Anyway I thought it would be interesting to write down what results I expect after sitting the exams, and then compare them to the results I actually get in August. I did all exams at higher level, and was aiming for 430, but i only really want 400 to be honest &#8211; anything over that is a bonus. Anyway here are the results I expect:</p>
<table style="height: 143px;" width="400">
<tbody>
<tr>
<th></th>
<th>Subject</th>
<th>Grade</th>
<th>Points</th>
</tr>
<tr>
<td>1.</td>
<td>English</td>
<td>C1</td>
<td>70</td>
</tr>
<tr>
<td>2.</td>
<td>Gaeilge</td>
<td>B1</td>
<td>85</td>
</tr>
<tr>
<td>3.</td>
<td>Maths</td>
<td>C2</td>
<td>65</td>
</tr>
<tr>
<td>4.</td>
<td>French</td>
<td>C1</td>
<td>70</td>
</tr>
<tr>
<td>5.</td>
<td>Art</td>
<td>C2</td>
<td>65</td>
</tr>
<tr>
<td>6.</td>
<td>Physics</td>
<td>D1</td>
<td>55</td>
</tr>
<tr>
<td>7.</td>
<td>Design &amp; Communication Graphics</td>
<td>D3</td>
<td>45</td>
</tr>
<tr>
<td></td>
<td></td>
<td><strong>Total:</strong></td>
<td>410</td>
</tr>
</tbody>
</table>
<p>If I do get 410 points I should have enough to do my preferred course in UCD, Computer Science DN030. Two years ago the points were 300 for the course and last year 370. I don&#8217;t expect them to go over 400, but you never know taking into consideration that there was a 40% increase in CAO applications this year.<br />
So I better get doing what I do best &#8211; party! To finish I would like to say a quote from one of the best movies of all time:</p>
<p>&#8220;<em>This is the last of that sort of thing. I&#8217;m cleaning up and I&#8217;m moving on, going straight and choosing life. I&#8217;m looking forward to it already. I&#8217;m gonna be just like you: the job; the family; the fucking big television; the washing machine; the car; the compact disc and electrical tin opener; good health; low cholesterol; dental insurance; mortgage; starter home; leisure wear; luggage; 3 piece suite; DIY; game shows; junk food; children; walks in the park; 9 to 5; good at golf; washing the car; choice of sweaters; family Christmas; index pension; tax exemption; clearing gutters; getting by; looking ahead; the day you die.</em>&#8221; <strong>Trainspotting</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.macaoidh.name/2010/06/21/finally-finished/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OS X VIM Syntax Highlighting</title>
		<link>http://blog.macaoidh.name/2010/06/12/os-x-vim-syntax-highlighting/</link>
		<comments>http://blog.macaoidh.name/2010/06/12/os-x-vim-syntax-highlighting/#comments</comments>
		<pubDate>Sat, 12 Jun 2010 09:21:43 +0000</pubDate>
		<dc:creator>Conor</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[preferences]]></category>
		<category><![CDATA[settings]]></category>
		<category><![CDATA[Syntax Highlighting]]></category>
		<category><![CDATA[vim]]></category>
		<category><![CDATA[vim highlighting]]></category>

		<guid isPermaLink="false">http://blog.macaoidh.name/?p=303</guid>
		<description><![CDATA[Syntax highlighting isn&#8217;t enabled by default on OS X, though it&#8217;s easy enough to set it up, and a few other small enhancments at the same it. Start by executing this command: cd /usr/share/vim &#38;&#38; sudo vim vimrc After entering your password press i to enter insertion mode and add the following lines after the [...]]]></description>
			<content:encoded><![CDATA[<p>Syntax highlighting isn&#8217;t enabled by default on OS X, though it&#8217;s easy enough to set it up, and a few other small enhancments at the same it.</p>
<p>Start by executing this command:</p>
<pre class="brush:bash">cd /usr/share/vim &amp;&amp; sudo vim vimrc</pre>
<p>After entering your password press <strong>i</strong> to enter insertion mode and add the following lines after the line set backspace=2:</p>
<pre class="brush:bash">
set showmatch           " automatically show matching brackets
set binary noeol        " do NOT put a carriage return at the end of the last line
set backspace=indent,eol,start  " make that backspace key work the way it should
set history=100         " keep 100 lines of history
set ruler               " show the cursor position
syntax on               " syntax highlighting
set hlsearch            " highlight the last searched term
filetype plugin on      " use the file type plugins

" When editing a file, always jump to the last cursor position
autocmd BufReadPost *
\ if ! exists("g:leave_my_cursor_position_alone") |
\ if line("'\"") > 0 &#038;&#038; line ("'\"") < = line("$") |
\ exe "normal g'\"" |
\ endif |
\ endif</pre>
<p>The lines above add syntax highlighting and a few other useful things. The line <code>set binary noeol</code> is very important for web developers. For example if you are programming in PHP and you leave a space outside the closing <code>?></code> it will cause http headers to be needlessly sent. That line prevents that from happening.</p>
<p>Well that's it if you press <strong>ESC</strong> then type <strong>:wq</strong> you will return to the terminal. Try editing some files again and the highlighting should be enabled.</p>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.macaoidh.name/2010/06/12/os-x-vim-syntax-highlighting/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Tá an Rialtas Seo Dár dTréigean Gan Dabht</title>
		<link>http://blog.macaoidh.name/2010/04/02/ta-an-rialtas-seo-dar-dtreigean-gan-dabht/</link>
		<comments>http://blog.macaoidh.name/2010/04/02/ta-an-rialtas-seo-dar-dtreigean-gan-dabht/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 11:04:08 +0000</pubDate>
		<dc:creator>Conor</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Gaeilge]]></category>

		<guid isPermaLink="false">http://blog.macaoidh.name/?p=300</guid>
		<description><![CDATA[I wrote a letter into Foinse last week, thats the Irish newspaper released with the Irish Independent. It was my first piece ever published: A Eagarthóir, Sílim go bhfuil an ceart ag Micheál Ó Conaire sa mhéid a dúirt sé in eagrán 14 Márta go dteastaíonn réabhlóid sa tír seo, ach ní amháin ó thaobh [...]]]></description>
			<content:encoded><![CDATA[<p>I wrote a letter into <a href="http://www.foinse.ie">Foinse</a> last week, thats the Irish newspaper released with the <a href="http://www.independent.ie/">Irish Independent</a>. It was my first piece ever published:</p>
<p>A Eagarthóir,</p>
<p>Sílim go bhfuil an ceart ag Micheál Ó Conaire sa mhéid a dúirt sé in eagrán 14 Márta go dteastaíonn réabhlóid sa tír seo, ach ní amháin ó thaobh na Gaeilge de.</p>
<p>Tá muintir na tíre seo scriosta le blianta de dhúshaothrú polaitíochta. Ní thuigim cén fáth go dtoghfar na polaiteoirí gairmeacha seo arís agus arís eile, iad atá ag amharc amach dóibh féin agus dá bpocaí féin. Le himeacht gach lae tá scéalta scannalacha faoi speansaisí agus caimiléireacht ag teacht chun cinn. Cá huair a n-athneoidh muid an fhadhb seo – cathain a n-athneoidh muid nach bhfuil córas neo-libearálach na tíre ag tuilleadh tada seachas léirscrios eacnamaíochta?</p>
<p>Tá reabhlóid shíochánta de dhíth sa tír seo – atheagrú iomlán ar achan rud. Tá a fhios agam go bhfuil na ráitis seo an-ghinéaralta, ach tá an oiread sin fadhbanna leis an chóras atá lofa leis an dúshaothrú agus an chaimiléireacht go bhfuil sé do-dhéanta iad go léir a phlé sa litir seo. Mothaíom go bhfuil an rialtas dár dtréigean, agus mothaíom nach bhfuil iontaobhas ar bith fágtha agam as. Is brónach an rud é sin a rá, ach ní féidir linn athrú ar bith a dhéanamh gan seasamh suas chun na faidhbe seo.</p>
<p>Impaím oraibh smaoineamh faoi seo, agus sa chéad mhór-toghchán eile do vóta a mhilleadh. Caithfidh muid a thaispáint nach amháin go bhfuil muinín caillte againn sa rialtas, ach sa chóras iomlán freisin.</p>
<p>Is Mise Le Meas</p>
<p>Conor Mac Aoidh</p>
<p>Muineachán</p>
<p>As a result of the letter I have been asked to write a piece on Ireland&#8217;s inefficient methods of recycling as Gaeilge for a Galway based newspaper, and I&#8217;ll send it to Foinse as well to see if they&#8217;ll publish it! It could be a few weeks until I get around to it though&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.macaoidh.name/2010/04/02/ta-an-rialtas-seo-dar-dtreigean-gan-dabht/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Freedom Awaits&#8230;.</title>
		<link>http://blog.macaoidh.name/2010/03/31/freedom-awaits/</link>
		<comments>http://blog.macaoidh.name/2010/03/31/freedom-awaits/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 13:35:48 +0000</pubDate>
		<dc:creator>Conor</dc:creator>
				<category><![CDATA[Me]]></category>
		<category><![CDATA[School]]></category>

		<guid isPermaLink="false">http://blog.macaoidh.name/?p=296</guid>
		<description><![CDATA[As you may have noticed I haven&#8217;t had much of an online presence recently &#8211; my life has descended into a mundane daily routine consisting of study, eh study, eh study, house, study and sleep! In fact I have recently given up programming, on a temporary basis, for the greater good. Until a few days [...]]]></description>
			<content:encoded><![CDATA[<p>As you may have noticed I haven&#8217;t had much of an online presence recently &#8211; my life has descended into a mundane daily routine consisting of study, eh study, eh study, house, study and sleep!</p>
<p>In fact I have recently given up programming, on a temporary basis, for the greater good. Until a few days ago I had done near no programming since Christmas. But a client asked me to do a reasonably small job for him since I wouldn&#8217;t have a chance to do it again for a while&#8230; In my absence I had actually completely forgotten how much I enjoyed programming, well now I know again and am dreading giving it up next week.</p>
<p>Alas, the light at the end of the tunnel is near. Two months further to test my tolerance and then an eternity of freedom. There&#8217;s so much I want to achieve and after the Leaving Cert I will have my chance to do that and to program to my hearts content.</p>
<p>Almost immediately after I get bored of that I will be submerged into the party atmosphere which is college. At the moment I am planning on going to UCD, with Trinity coming in close second. Anyway what more could I want in life than college? Programming by day, drinking by night. The odd ridiculously crazy fiasco&#8230;</p>
<p>But until then I must return to my world of cramming.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.macaoidh.name/2010/03/31/freedom-awaits/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Furasta.Org 1.0 Pre-Alpha</title>
		<link>http://blog.macaoidh.name/2009/12/30/furasta-org-1-0-pre-alpha/</link>
		<comments>http://blog.macaoidh.name/2009/12/30/furasta-org-1-0-pre-alpha/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 20:40:45 +0000</pubDate>
		<dc:creator>Conor</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[Web Projects]]></category>
		<category><![CDATA[1.0]]></category>
		<category><![CDATA[alpha]]></category>
		<category><![CDATA[furasta]]></category>
		<category><![CDATA[furasta cms]]></category>
		<category><![CDATA[furasta org]]></category>
		<category><![CDATA[pre-alpha]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[screenshots]]></category>

		<guid isPermaLink="false">http://blog.macaoidh.name/?p=293</guid>
		<description><![CDATA[I have been doing a lot of development on Furasta recently and the project is nearing an alpha release &#8211; I hope to have it out next week at some stage. Below I have attached a screenshot of the new admin interface. The release won&#8217;t be feature packed, but the plugin architecture should be working. [...]]]></description>
			<content:encoded><![CDATA[<p>I have been doing a lot of development on Furasta recently and the project is nearing an alpha release &#8211; I hope to have it out next week at some stage.</p>
<p>Below I have attached a screenshot of the new admin interface.</p>
<div id="attachment_292" class="wp-caption alignnone" style="width: 640px"><a href="http://blog.macaoidh.name/wp-content/uploads/2009/12/furasta-pre-alpha.png"><img class="size-full wp-image-292" title="Furasta Pre-Alpha Screenshot" src="http://blog.macaoidh.name/wp-content/uploads/2009/12/furasta-pre-alpha.png" alt="Furasta Pre-Alpha Screenshot" width="630" height="200" /></a><p class="wp-caption-text">A sneak preview of what is to come in Furasta.Org 1.0</p></div>
<p>The release won&#8217;t be feature packed, but the plugin architecture should be working. Note that the SVN has not been updated in ages, but I should get around to it next week as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.macaoidh.name/2009/12/30/furasta-org-1-0-pre-alpha/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mac OS X &#8211; VIM Templates</title>
		<link>http://blog.macaoidh.name/2009/12/24/mac-os-x-vim-templates/</link>
		<comments>http://blog.macaoidh.name/2009/12/24/mac-os-x-vim-templates/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 22:18:41 +0000</pubDate>
		<dc:creator>Conor</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[system]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[templating system]]></category>
		<category><![CDATA[vim]]></category>
		<category><![CDATA[with vim]]></category>

		<guid isPermaLink="false">http://blog.macaoidh.name/?p=288</guid>
		<description><![CDATA[I have always wondered if it was possible to use a template system with VIM. Whenever I used large editors it was usually because of the default template schemes they allow. I have always preferred using VIM because it&#8217;s so practical, and it&#8217;s useful to be able to execute commands in-between editing files. Well anyway [...]]]></description>
			<content:encoded><![CDATA[<p>I have always wondered if it was possible to use a template system with VIM. Whenever I used large editors it was usually because of the default template schemes they allow. I have always preferred using VIM because it&#8217;s so practical, and it&#8217;s useful to be able to execute commands in-between editing files.</p>
<p>Well anyway here are a few commands to configure a vim template system on UNIX (It should work on both OSX and Linux):</p>
<ul>
<li>Download the template system:
<pre class="brush: bash">curl -C - -O http://www.vim.org/scripts/download_script.php?src_id=3747</pre>
</li>
<li>Open VIM:
<pre class="brush: bash">sudo vim</pre>
</li>
<li>Source the file you have downloaded from within VIM by typing:
<pre class="brush: bash">:source ./download_script.php\?src_id=3747</pre>
</li>
<li>Now the VIM template system has been configured. The previous command should output the template directory so that you can create new templates, it differs depending on your OS.</li>
</ul>
<p>That&#8217;s it if you need more info on how the system works you can visit the project homepage <a href="http://www.vim.org/scripts/script.php?script_id=1172">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.macaoidh.name/2009/12/24/mac-os-x-vim-templates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java &#8211; Drawing Squares</title>
		<link>http://blog.macaoidh.name/2009/12/05/java-drawing-squares/</link>
		<comments>http://blog.macaoidh.name/2009/12/05/java-drawing-squares/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 03:28:07 +0000</pubDate>
		<dc:creator>Conor</dc:creator>
				<category><![CDATA[College]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Languages]]></category>
		<category><![CDATA[drawing]]></category>
		<category><![CDATA[icsp]]></category>
		<category><![CDATA[reges]]></category>
		<category><![CDATA[regular expression]]></category>
		<category><![CDATA[shape]]></category>
		<category><![CDATA[squares]]></category>

		<guid isPermaLink="false">http://blog.macaoidh.name/?p=284</guid>
		<description><![CDATA[This weeks ICSP assignment was to write a program which draws squares. The task was to draw squares from a set list in an array, but I opted rather to accept a command line argument in my script. To write this I had to delve back into regular expression, which I hate because I don&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>This weeks ICSP assignment was to write a program which draws squares. The task was to draw squares from a set list in an array, but I opted rather to accept a command line argument in my script. To write this I had to delve back into regular expression, which I hate because I don&#8217;t understand!</p>
<p>The program source is below. You should execute the program from the command line giving the with and height of the square you wish to draw, for example:</p>
<pre class="brush: bash">
java Squares 4x4
</pre>
<p>And the code:</p>
<pre class="brush: java">
import java.lang.String;
import java.util.regex.*;

public class Squares{
        public int dimensions[];

        public Squares(String[] args){
                if(args.length==1){
                        Pattern form=Pattern.compile("^\\S+x\\S+$");
                        Matcher fit=form.matcher(args[0]);
                        if(fit.matches()){
                                try{
                                        String[] dims=args[0].split("x");
                                        int width=Integer.parseInt(dims[0]);
                                        int height=Integer.parseInt(dims[1]);
                                        this.dimensions=new int[] {width,height};
                                }
                                catch(NumberFormatException e){
                                        System.err.println("Argument must be a string, width by height, in the form 6x6");
                                        System.exit(1);
                                }
                        }
                        else{
                                System.out.println("Argument must be a string, width by height, in the form 6x6");
                                System.exit(1);
                        }
                }
                else{
                        System.err.println("Please supply an argument, which must be a string, width by height, in the form 6x6");
                        System.exit(0);
                }
        }

        public String draw(){
                int i;
                int z;
                int width=this.dimensions[0];
                int height=this.dimensions[1];
                String square="";

                for(i=0;i&lt;height ;i++){
                        for(z=0;z&lt;width;z++){
                                if((i==0||i==height-1)&#038;&#038;(z==0||z==width-1))
                                        square+="+";
                                else if(z==0||z==width-1)
                                        square+="|";
                                else if((i==0||i==height-1))
                                        square+="-";
                                else
                                        square+=" ";
                        }
                        square+="\n";
                }

                return square;
        }

        public static void main(String[] args){
                Squares square=new Squares(args);
                String draw=square.draw();
                System.out.println(draw);
        }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.macaoidh.name/2009/12/05/java-drawing-squares/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java &#8211; Calculate Taxi Fares</title>
		<link>http://blog.macaoidh.name/2009/12/02/java-calculate-taxi-fares/</link>
		<comments>http://blog.macaoidh.name/2009/12/02/java-calculate-taxi-fares/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 00:21:25 +0000</pubDate>
		<dc:creator>Conor</dc:creator>
				<category><![CDATA[College]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Languages]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[fare]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[Scratch]]></category>
		<category><![CDATA[taxi]]></category>

		<guid isPermaLink="false">http://blog.macaoidh.name/?p=281</guid>
		<description><![CDATA[This week my ICSP assignment was to calculate taxi fares. The task was: Using the fare table write a program that calculates the fares and test if it is correct. Upload your .java or your Scratch file. A template file for java will be provided. (Hint, only the boundary values needs to be tested. The [...]]]></description>
			<content:encoded><![CDATA[<p>This week my ICSP assignment was to calculate taxi fares. The task was:</p>
<blockquote><p>Using the fare table write a program that calculates the fares and test if it is correct. Upload your .java or your Scratch file. A template file for java will be provided. (Hint, only the boundary values needs to be tested. The fare table is also presented in the slides. The compile command for java should be &#8220;javac TaxiRide.java&#8221;)</p>
<table border="0">
<tbody>
<tr>
<th colspan="2">Fare table</th>
</tr>
<tr>
<th>Distance (km)</th>
<th>Cost (€)</th>
</tr>
<tr>
<td>&gt;50</td>
<td>30</td>
</tr>
<tr>
<td>50-100</td>
<td>25, plus 9 for each km &gt; 50</td>
</tr>
<tr>
<td>100 &#8211; 2000</td>
<td>190, plus 8 for each km &gt; 100</td>
</tr>
<tr>
<td>&gt; 2000</td>
<td>1800</td>
</tr>
</tbody>
</table>
</blockquote>
<p>It wasn&#8217;t the hardest task. The only thing that confused me was the Java switch syntax. In PHP you can have conditions in a switch statement such as:</p>
<pre class="brush:php">
&lt;?php
switch($num){
        case ($num&lt;10):
                // blah
        break;
        case ($num&lt;100):
                // blah
        break;
        default:
                //blah
?&gt;
</pre>
<p>I couldn&#8217;t get Java to accept anything other than a value for the variable bring switched. So I did it the old-fashioned way! My code is below&#8230;</p>
<pre class="brush:java">
public class TaxiRide{
        public int distance=0;

        public TaxiRide(String arg){
                try{
                        int distance=Integer.parseInt(arg);
                        this.distance=distance;
                }
                catch(NumberFormatException e){
                        System.err.println("Arguement must be an integer representing the distance traveled");
                        System.exit(1);
                }
        }

        public int calculateFare(){
                int distance=this.distance;
                int fare=0;
                int i=0;
                if(distance&lt;50){
                        return 30;
                }
                if(distance%lt;100){
                        fare=25;
                        distance-=50;
                        for(i=0;i&lt;distance;i++){
                                fare+=9;
                        }
                        return fare;
                }
                if(distance&lt;2000){
                        fare=190;
                        distance-=100;
                        for(i=0;i&lt;distance;i++){
                                fare+=8;
                        }
                        return fare;
                }
                return 1800;
        }

        public static void main(String[] args){
                TaxiRide taxiRide = new TaxiRide(args[0]);
                int fare=taxiRide.calculateFare();
                System.out.println("The fare is: "+fare+" euro for traveling "+taxiRide.distance+"kM\n Thank you\n");
        }
}
</pre>
<p>I feel i am learning a lot from this course. Lately I have been experimenting in a few different languages. I added a bit to the Scratch Linux installer, written in Perl, so that it added an icon in the applications menu during installation. I&#8217;ve also been messing around with bash, trying to automate some of my most common commands&#8230; was thinking of writing a small bash script that backed up my data when my external hard drive is plugged in, similar to Time Machine on OSX.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.macaoidh.name/2009/12/02/java-calculate-taxi-fares/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
