<?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&#039;s Blog &#187; Languages</title>
	<atom:link href="http://conor.macaoidh.ie/blog/category/languages/feed/" rel="self" type="application/rss+xml" />
	<link>http://conor.macaoidh.ie</link>
	<description>PHP, Music, Linux</description>
	<lastBuildDate>Mon, 07 Jul 2014 10:53:35 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9.1</generator>
	<item>
		<title>GNU Test Runner v2.0</title>
		<link>http://conor.macaoidh.ie/blog/2014/07/07/gnu-test-runner-v2-0/</link>
		<comments>http://conor.macaoidh.ie/blog/2014/07/07/gnu-test-runner-v2-0/#comments</comments>
		<pubDate>Mon, 07 Jul 2014 10:43:34 +0000</pubDate>
		<dc:creator><![CDATA[Conor]]></dc:creator>
				<category><![CDATA[Compilers]]></category>
		<category><![CDATA[Languages]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[compiler]]></category>
		<category><![CDATA[gcc]]></category>
		<category><![CDATA[gnu]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[report]]></category>
		<category><![CDATA[runner]]></category>
		<category><![CDATA[suite]]></category>
		<category><![CDATA[test]]></category>
		<category><![CDATA[toolchain]]></category>
		<category><![CDATA[viewer]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[xunit]]></category>

		<guid isPermaLink="false">http://conor.macaoidh.ie/?p=553</guid>
		<description><![CDATA[The GNU Test Runner is a compiler testing tool that enables multi-threaded compilation of test cases. I worked on this project on and off over the last year at Movidius. Originally, this project was compatible with only the Movidius Myriad toolchain. However, with permission from the company I have been working on a toolchain agnostic [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>The GNU Test Runner is a compiler testing tool that enables multi-threaded compilation of test cases. I worked on this project on and off over the last year at <a href="http://www.movidius.com">Movidius.</a> Originally, this project was compatible with only the Movidius Myriad toolchain. However, with permission from the company I have been working on a toolchain agnostic version of the application which I have now released under the GNU General Public Licence v3.</p>
<p>The test runner essentially provides a fault tolerant method of running large test suites (20k+) using any toolchain. It supports concurrent running of jobs and reducing job creation during heavy system load. Test suites such as the <a href="https://gcc.gnu.org/onlinedocs/gccint/C-Tests.html#C-Tests">GNU GCC test suite</a> can be used with the test runner.</p>
<p>A typical configuration of the test runner defines a number of tool passes required to complete each test case: compile, assemble, link, execute/simulate.</p>
<p>The test runner generates report files based on a test run in the Xunit XML format. This report is a self-contained assessment of the test run. Additional metadata is attached to the report file, such as markers for pass/fail for each tool in each test case, timings for each tool, extracted data from each tool (such as logging the &#8216;Instruction Count&#8217; or &#8216;Instruction Level Parallelism&#8217; metrics from the simulator stdout). Many more features are available.</p>
<p>I have also been working on a web viewer for the GNU Test Runner. This is a web interface for viewing testrun reports and comparing them for regressions. The web interface will also be released soon.</p>
<p>The GNU Test Runner is available for download here:</p>
<p><a href="http://src.macaoidh.ie/p/test-runner/">http://src.macaoidh.ie/p/test-runner/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://conor.macaoidh.ie/blog/2014/07/07/gnu-test-runner-v2-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ssh-agent remember ssh key password</title>
		<link>http://conor.macaoidh.ie/blog/2014/07/06/ssh-agent-remember-ssh-key-password/</link>
		<comments>http://conor.macaoidh.ie/blog/2014/07/06/ssh-agent-remember-ssh-key-password/#comments</comments>
		<pubDate>Sun, 06 Jul 2014 20:16:08 +0000</pubDate>
		<dc:creator><![CDATA[Conor]]></dc:creator>
				<category><![CDATA[Awesome WM]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Languages]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[awesome]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[key]]></category>
		<category><![CDATA[passphrase]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[remember]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[ssh-add]]></category>
		<category><![CDATA[ssh-agent]]></category>
		<category><![CDATA[wm]]></category>

		<guid isPermaLink="false">http://conor.macaoidh.ie/?p=546</guid>
		<description><![CDATA[I&#8217;m using awesome wm. Previously I had used it with gnome, and used gnome-keyring to manage ssh keys. Without gnome, the ssh-agent tool can be used to keep track of ssh key passwords for the session. In order to remember your ssh key passwords, an alias for the ssh command can be added to the [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m using <a href="http://awesome.naquadah.org/">awesome wm</a>. Previously I had used it with gnome, and used <em>gnome-keyring</em> to manage ssh keys. Without gnome, the <em>ssh-agent</em> tool can be used to keep track of ssh key passwords for the session.</p>
<p>In order to remember your ssh key passwords, an alias for the <em>ssh</em> command can be added to the <em>~/.bashrc</em> file:</p>
<pre>alias ssh="CT=\$(ssh-add -l | grep \"id_dsa\" | wc -l) ; if [[ \$CT -eq 0 ]] ; then ssh-add ; fi ; ssh"</pre>
<p>This does the following:</p>
<ol>
<li>Check the list of added identities for this session</li>
<li>Check if the required identity is present (<em>~/.ssh/id_dsa</em>)</li>
<li>If it is not, add the ssh identity to <em>ssh-agent</em> (which prompts for password)</li>
<li>Run ssh normally</li>
</ol>
<p>Using this alias for ssh, you only need to enter your password once.</p>
]]></content:encoded>
			<wfw:commentRss>http://conor.macaoidh.ie/blog/2014/07/06/ssh-agent-remember-ssh-key-password/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Form Validation Plugin v1.1</title>
		<link>http://conor.macaoidh.ie/blog/2011/03/12/jquery-form-validation-plugin-v1-1/</link>
		<comments>http://conor.macaoidh.ie/blog/2011/03/12/jquery-form-validation-plugin-v1-1/#comments</comments>
		<pubDate>Sat, 12 Mar 2011 23:33:56 +0000</pubDate>
		<dc:creator><![CDATA[Conor]]></dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Languages]]></category>
		<category><![CDATA[create form]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[validate]]></category>
		<category><![CDATA[validation]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://blog.conormacaoidh.com/?p=430</guid>
		<description><![CDATA[A small update to the jquery form validation plugin. This fixes a bug with the pattern function and also adds the ability to have custom error messages in the function. It is backwards compatible. The pattern function can now be used in both these ways: $( "#form" ).validate( { "input-name" : { "pattern" : [ [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>A small update to the jquery form validation plugin. This fixes a bug with the pattern function and also adds the ability to have custom error messages in the function. It is backwards compatible. The pattern function can now be used in both these ways:</p>
<pre class="brush:php">
$( "#form" ).validate( { "input-name" : { "pattern" : [ /^[A-Za-z0-9 ]{2,40}$/,
"The content field must be between 2 and 40 characters" ] } } );<br />
$( "#form" ).validate( { "input-name" : { "pattern" : /^[A-Za-z0-9 ]{2,40}$/ } } );</pre>
<p>
I&#8217;m not going to update the demo for this minor release but you can download the updated plugin files here:</p>
<h3><a href="http://files.macaoidh.name/Download/jquery-form-validation-plugin-v1-1">Download All ( Demo, Minified and unminified versions )</a></h3>
<p>
At this stage there are over 100 downloads of the plugin so some people must be using it. Feel free to leave feedback, suggest improvements, etc.</p>
]]></content:encoded>
			<wfw:commentRss>http://conor.macaoidh.ie/blog/2011/03/12/jquery-form-validation-plugin-v1-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Slot Machine Game</title>
		<link>http://conor.macaoidh.ie/blog/2011/02/20/slot-machine-game/</link>
		<comments>http://conor.macaoidh.ie/blog/2011/02/20/slot-machine-game/#comments</comments>
		<pubDate>Sun, 20 Feb 2011 00:09:42 +0000</pubDate>
		<dc:creator><![CDATA[Conor]]></dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[College]]></category>
		<category><![CDATA[Languages]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[college]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[machine]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[slot]]></category>

		<guid isPermaLink="false">http://blog.conormacaoidh.com/?p=427</guid>
		<description><![CDATA[I wrote a slot machine game for a college project over the last week or two. The specification was as follows: For this assignment, you are asked to implement a command line version of a slot machine in C. The slot machine consists of three columns, and each column can hold one of three possible [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I wrote a slot machine game for a college project over the last week or two. The specification was as follows:</p>
<p><em>For this assignment, you are asked to implement a command line version of a slot machine in C. The slot machine consists of three columns, and each column can hold one of three possible values: ‘APPLE’, ‘ORANGE’ or ‘PEAR’.<br />
When the slot machine begins, the player is asked to bet X amount of their initial credit, I (default value for I should be 10 credits), where X &lt;= I. For each play of the slot machine there are three possible outcomes:<br />
1.    Full house – all 3 columns contain the same value. Player wins the amount they bet (i.e. X). X (winnings) should be added to current credit balance (or I if initial run) to form new credit balance.<br />
2.    Half house –2 of the 3 columns contain the same value. Player wins half the amount they bet (i.e. X/2). X/2 (winnings) should be added to current credit balance (or I if initial run) to form new credit balance.<br />
3.    Empty house &#8211; all 3 columns contain different values. Player loses 10 credits. 10 credits should be removed from current credit balance (or I if initial run) to form new credit balance.</em></p>
<p>We had four weeks to finish the project which was way more than was really required to write it. There were a few other requirements which aren&#8217;t mentioned here. Anyway I have included a link to a downloadable and executable version of the game. The download includes SlotMacine ( a binary file ), SlotMachine.exe ( the same as SlotMachine, filename just makes it easier to execute under Windows ) and SlotMachine.c</p>
<h2><a href="http://files.macaoidh.name/Download/SlotMachine.zip">Download Slot Machine Game</a></h2>
<p>Feel free to leave feedback.</p>
]]></content:encoded>
			<wfw:commentRss>http://conor.macaoidh.ie/blog/2011/02/20/slot-machine-game/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Compressing and Splitting Files</title>
		<link>http://conor.macaoidh.ie/blog/2011/01/23/compressing-and-splitting-files/</link>
		<comments>http://conor.macaoidh.ie/blog/2011/01/23/compressing-and-splitting-files/#comments</comments>
		<pubDate>Sun, 23 Jan 2011 14:40:26 +0000</pubDate>
		<dc:creator><![CDATA[Conor]]></dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Languages]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[computer]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[memory stick]]></category>
		<category><![CDATA[move]]></category>
		<category><![CDATA[rar]]></category>
		<category><![CDATA[splitting]]></category>
		<category><![CDATA[transfer]]></category>
		<category><![CDATA[usb]]></category>

		<guid isPermaLink="false">http://blog.conormacaoidh.com/?p=422</guid>
		<description><![CDATA[I came across a problem yesterday when I had to move a 6.8GB file over to another computer with only a 4GB memory stick. Then it dawned on me to split the files in half and to put them back together on the other side. One thing to remember in this process is that if [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I came across a problem yesterday when I had to move a 6.8GB file over to another computer with only a 4GB memory stick. Then it dawned on me to split the files in half and to put them back together on the other side. One thing to remember in this process is that if a memory stick says its 4GB it most likely is only 4000MB. Here&#8217;s how I did it:</p>
<p>So first compress the file:</p>
<p><strong>tar </strong><strong>-zcvf</strong><strong> FILE_NAME.tar.gz FILE_TO_COMPRESS</strong></p>
<p>Then split the file into two segments:</p>
<p><strong>split -b</strong><strong>4000m FILE_NAME.tar.gz</strong></p>
<p>That last command might take a while to finish. It will split the file into however many files of the given size it can create. The files are prefixed with the letter x. So copy the files over to the other computer. Use the cat command to re-assemble them:</p>
<p><strong>cat x* &gt; COMPLETE_FILE_NAME.tar.gz</strong></p>
<p><strong>tar -zxvf FILE_NAME.tar.gz</strong></p>
<p>Then that&#8217;s it, file moved from one computer to the other using compression and splitting.<strong><br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://conor.macaoidh.ie/blog/2011/01/23/compressing-and-splitting-files/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jQuery Form Validation Plugin</title>
		<link>http://conor.macaoidh.ie/blog/2011/01/20/jquery-form-validation-plugin/</link>
		<comments>http://conor.macaoidh.ie/blog/2011/01/20/jquery-form-validation-plugin/#comments</comments>
		<pubDate>Thu, 20 Jan 2011 13:35:41 +0000</pubDate>
		<dc:creator><![CDATA[Conor]]></dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Languages]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[validation]]></category>
		<category><![CDATA[validator]]></category>

		<guid isPermaLink="false">http://blog.conormacaoidh.com/?p=417</guid>
		<description><![CDATA[From time to time while developing Furasta.Org i write a piece of code which may be useful to others, this is one such piece of code. I have detached this from the Furasta.Org project and made a jquery plugin which will work on any form. Please feel free to look at the demo, view the [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>From time to time while developing Furasta.Org i write a piece of code which may be useful to others, this is one such piece of code. I have detached this from the Furasta.Org project and made a <a href="http://plugins.jquery.com/project/form-validation">jquery plugin</a> which will work on any form. Please feel free to look at <a href="http://files.macaoidh.name/demos/jquery-form-validation-plugin/">the demo</a>, view <a href="http://files.macaoidh.name/demos/jquery-form-validation-plugin/validate.jquery.js">the unminified source code</a>, or download <a href="http://files.macaoidh.name/Download/jquery-form-validation-plugin">the minified code</a>. For those of you who didn&#8217;t bother reading this:<a href="http://files.macaoidh.name/demos/jquery-form-validation-plugin/"></a></p>
<h2><a href="http://files.macaoidh.name/demos/jquery-form-validation-plugin/">Demo</a></h2>
<h2><a href="http://files.macaoidh.name/demos/jquery-form-validation-plugin/validate.jquery.js">Documentation ( Read the Comments! )</a></h2>
<h2><a href="http://files.macaoidh.name/Download/jquery-form-validation-plugin">Download All ( Demo, Minified and unminified versions )</a></h2>
<p>Feel free to leave feedback, suggest improvements, etc.</p>
]]></content:encoded>
			<wfw:commentRss>http://conor.macaoidh.ie/blog/2011/01/20/jquery-form-validation-plugin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Essence of Computer Science</title>
		<link>http://conor.macaoidh.ie/blog/2010/12/10/the-essence-of-computer-science/</link>
		<comments>http://conor.macaoidh.ie/blog/2010/12/10/the-essence-of-computer-science/#comments</comments>
		<pubDate>Fri, 10 Dec 2010 13:34:19 +0000</pubDate>
		<dc:creator><![CDATA[Conor]]></dc:creator>
				<category><![CDATA[College]]></category>
		<category><![CDATA[Languages]]></category>

		<guid isPermaLink="false">http://blog.macaoidh.name/?p=410</guid>
		<description><![CDATA[This is my end of semester essay for CS. Oh and the thing about me not knowing what programming languages were before college is untrue but it adds to the essay! The Essence of Computer Science – that is what I am here to learn. Through the few weeks of college, we were given an [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>This is my end of semester essay for CS. Oh and the thing about me not knowing what programming languages were before college is untrue but it adds to the essay!</p>
<p>The Essence of Computer Science – that is what I am here to learn. Through the few weeks of college, we were given an outline of the course and what we had to learn and understand to become computer scientists. So far, we have learned what programming languages are and, more importantly, why they are used. We have attended a vast range of lectures on subjects such as search engines, design patterns, compression, databases and much much more. The lecturers did not delve too deeply into these but outlined some of the areas of Computer Science in which we will be working. In this essay, I will discuss these topics in detail to show you my understanding of Computer Science (CS).</p>
<p>The first question that dawned on me when I started CS was: What is a programming language and why must we use it? Now I think I have the answer. Programming languages were created to replace the flaws in most communicative languages with a precise, definitive syntax. In English, words may have many meanings. Take this sentence for example: ‘<em>If she calls, please tell Teresa I’ve gone to bed.’</em> In this case the word ‘call’ could mean a telephone call, or a literal call. Moreover, it is not certain whether Teresa is the ‘she’ that might call, or whether it is another woman. There is no precise interpretation of this sentence. Programming languages are designed to remove the ambiguities and multiple interpretations that are present in common communicative languages.</p>
<p>If that’s true, then why are there so many different languages? We were told at the beginning of the course that we would be studying a host of languages including C, C++, Java and Perl but there are many more: PHP, Haskel, ASP, Basic, Assembler&#8230; the list goes on. The answer is that these languages all serve different purposes. C, for example, offers great freedom but developers must suffer slow programming to produce fast programs. Interpreted languages such as Perl and PHP offer a simplified syntax resulting in low programming times but slower programs. C is more appropriate for system programming whereas PHP was designed to build dynamic web pages. One of the major points I learned is that CS is not all about programming. There are many aspects of CS and I learnt in the ‘Computer Science at Work’ submodule that business plays a big role in the industry.</p>
<p>The first topic that we covered this year was ‘Search Engines’. Everyone who uses the internet uses a search engine and there are many out there: Google, Bing, Yahoo, Startpage etc. The future of web searching is much debated. The current market leader is Google, which has adopted a vast amount of techniques that make searching easier. Google is without a doubt the smartest, fastest and most efficient search engine that I have used. However, there is controversy surrounding the amount of information that Google collects from its users. This has sparked a number of competitors, such as Scroogle and Startpage, which don’t collect any information about their users – even ip addresses remain anonymous. Websites’ page ranks on Google and other search engines define how popular they are and page-ranking has become extremely important to businesses. The page rank of a website is determined by quite a few factors, including the number of links to a website and a summary of the key words to be included in the Meta-tags of a site’s code. The process of improving a website’s page rank is called Search Engine Optimisation (SEO).</p>
<p>There are a number of ‘web apps’ which take different forms and give the user access to various aspects of the internet. We tested one of these apps, called HeyStaks, in one of our first practicals. HeyStaks is a Firefox add-on/plugin which serves to extend the capacity of Google, Yahoo and Bing, the three most popular search engines. I perceive Heystaks as the future direction of search engines because it integrates aspects of social networking with the searching process. With HeyStaks, users create ‘Staks’, collections of searches on particular topics. It is then possible to share these Staks with other users via the HeyStaks website. Eventually, a vast database of Staks will be created to streamline the searching process. Users won’t be depending on a machine’s opinion of what page is relevant – they will depend instead on the experiences of other users.</p>
<p>Google was the first major search engine and it has risen far higher than expected. However, it was not the first search engine – there were eighteen others before it. The architecture of a search engine was first proposed in the 1940s but there was no implementation of the technique at that time. Tim Berners-Lee is the father of the world wide web. He created the first web directory, essentially a list of all the websites in the world. It failed because of exponential growth in the number of search engines. Ten years later in 1998, Google was released. The web is so big these days that it is almost impossible to measure it. Around 12.4 billion English language websites are now listed by Google.</p>
<p>What made Google succeed where others failed? It is impossible to calculate recall for the web – there are simply too many pages to search. That’s why Google uses indexes and evaluates searches by their relevance. When searching for the query, ‘Is drinking red wine more effective at reducing your risk of heart attacks than white wine?’, only half of the results returned are accurate. Evaluation is about putting the science in Computer Science and comparing the performance of systems and algorithms. These factors are important in a search engine: the relevance of queries; speed; clear user-interface; free; discreet adds. Google used all of these techniques to create an incredibly efficient search engine. That is why it succeeded.</p>
<p>The future of web searching will be in the customisation of results specific to a particular user. Google has already done this to a certain extent. The homepage has a customisable background and the engine collects information on users to display a certain extent of user-specific content. There is no doubt that Google is the market leader at the moment but something big has happened recently which might just knock the company off its high chair. Recently, Facebook has signed a deal with Microsoft’s Bing to integrate social networking into the search engine. Facebook is quoted as saying that it went for Bing instead of Google because the ‘underdog’ has more incentive to work. It will be interesting to see what changes come to the process of searching the internet in the next few years.</p>
<p>Our guest lecturer, Dr Mel Ó Cinnéide, discussed ‘Learning and Patterns’ with us. He showed us examples of how patterns are used everywhere in life and told us that they have an implementation in programming as well. He told us that patterns are related to how we learn and said that it’s likely that a person will learn more in the first three or four years of their lives than in the rest of their lives.</p>
<p>There are three stages of learning: the cognitive stage, learning the basic elements; the associative stage, learning how the elements fit together; the autonomous stage, automatic and apparently effortless combining of elements. The autonomous stage consists of being a master in a certain field. An example of this is tying a shoelace. It seems simple to us now because we learnt it so long ago, but if we tried to learn how to do it now we would find it incredibly difficult. These three stages of learning were interpreted in the Middle Ages by the apprentice, the journeyman and the master. Bruce Lee is a master who has learnt a martial art and discovered its simplicity: <em>‘Now that I’ve understood the art, a punch is just a punch, a kick just a kick.’ </em>Masters often don’t know how exactly they do things. They are aware on a subconscious level of what they are doing but often it’s not necessary for them to think about it. Consider cycling a bike; we may not be able to answer detailed questions about how to cycle in theory but in practice we can all (well, most of us can) cycle.</p>
<p>One of the questions the lecturer asked us was: Do you think beauty is objective? I think it’s very subjective. People’s opinions of beauty differ but we are the same species and there are likely to be things that we all find beautiful, such as nature, the stars etc. If beauty was completely subjective then we would all like completely different things. The answer Dr Ó Cinnéide gave us was that beauty is a combination of the two, i.e. sometimes we don’t agree about what is beautiful but there are aspects of beauty which we all considered appealing. Christopher Alexander was a 1960s architect who attempted to find similarities between objects (such as doors) to discover the essence of what we consider beauty to be. In his own words: <em>‘Each pattern describes a problem which occurs over and over again in our environment, and then describes the core of the solution to that problem, in such a way that you can use this solution a million times over, without ever doing it the same way twice.’</em></p>
<p>A pattern is a proven solution to a recurring problem in a certain context. It isn’t a once off, it’s something that happens again and again, perhaps a bit different every time. On the surface, two problems might look different but there are probably aspects that connect them that can be exploited by patterns. The Gang of Four is a group of computer scientists who read about Alexander’s work (largely ignored by other architects) and wrote a book called <em>Design Patterns</em>. The book was a massive success and now almost all programmers use <em>Design Patterns</em> at some stage. It received 20,611 citations – 14,457 more than any of Einstein’s papers. The Gang of Four implemented Alexander’s understanding of patterns in programming.</p>
<p>Similar to patterns, objects can be used in programming to perform work. They are ideal because we don’t necessarily need to know how they work to use them. They are similar to the predefined functions in C – we don’t know how they work and most of us don’t need to know. If a software developer writes a lot of complicated code-using objects, then other programmers can easily use that code without needing to know the details of how it works. This is called Object Orientated Programming.</p>
<p>Algorithms are another example of programming techniques which use patterns. Computer scientists must learn to solve problems effectively using algorithms. <em>‘An algorithm is an effective method for solving a problem expressed as a finite sequence of steps.’ [</em><span style="text-decoration: underline;"><a href="http://en.wikipedia.org/wiki/Algorithm">http://en.wikipedia.org/wiki/Algorithm</a></span><em>]. </em>In a problem-solving process, a computer scientist should plan out an algorithm before programming it. A prime example of an algorithm is the Boyer-Moore String Search Algorithm, which implements a smart and incredibly efficient method of searching strings.</p>
<p>Another topic we covered with Dr Neil Hurley was ‘Lossless and Lossy Compression’. He highlighted how important compression is to computer scientists. Dr Hurley reiterated that mathematics is essential for Computer Science – the principles with which we design computer systems are based almost entirely on mathematics.</p>
<p>Everyone who uses a computer these days uses compression whether they know it or not. MP3 files are compressed and when we listen to them we are uncompressing them. Videos and some files are compressed or encoded. Compression is also used in digital communication. When a message is sent by instant messenger or email, the message is compressed, encoded and sent. Then it is decoded and uncompressed on the other side. Crackles on the phone line are an example of an error in encoding. Dr Hurley posed the question: What is a message? Every message is made of information and redundancy. If we remove the redundancy from the message we can still understand the points of the message. This is compression. A form of this is text messaging. Texting language uses abbreviations to reduce the redundancy in a message whilst retaining the essential information.</p>
<p>Compression enables fast communication but it is difficult to determine how much one should compress. Huffman coding is an easy method of effective compression. An uncompressed letter is represented in the computer by an eight-bit binary number. The computer uses ASCII coding to determine which eight-bit combination means which letter. There are 256 combinations of this eight-bit string. This is more than sufficient for the English language but not nearly enough for languages such as Chinese. Huffman asked why can there be only eight bits in the encoding scheme. He suggested that there could be different amount of bits allocated to each letter. Frequently used letters such as ‘a’ or ‘e’ should be stored with a small amount of bits representing them. Letters such as ‘z’ should have more bits representing them. This system would be more efficient than the current one. A Huffman tree can be used to further increase the efficiency of the encoding scheme. In this scheme the most frequently used letters have fewer bits than the least frequently used. After creating a Huffman tree and encoding the sentence ‘aaron adamson’, it is possible to improve the efficiency of the current system and reduce the sentence to 36% of its original size. Originally the sentence took up 104 bits of space but after applying the new Huffman tree it can be reduced to 38 bits.</p>
<p>Redundancy is a scheme which can be used to detect errors that occur when transmitting data over a channel. For example: when transmitting one bit of information – a true or false value – it is possible to send two bits rather than one, the second being for error detection. Hamming code can be used to detect and correct a single-bit error. Parity bits (extra bits) are placed at powers of 2 locations in the message. Adding this mathematical property allows us to tell not only when a single-bit error has occurred but where it occurred. It can also detect and correct certain errors. If we didn’t have error correction we wouldn’t be able to communicate reliably.</p>
<p>Huffman coding is an example of lossless compression. From a compressed message it is possible to recover the exact original message. This is contrary to lossy compression, which discards information that it doesn’t think is useful. Lossy compression uses sines and co-sines from the Fourier series to function. Lossy coding schemes use human limitation to compress information. For example, when compressing audio files, the compression engine takes into consideration the range of hertz that humans can hear and then eliminates inaudible sound from the file.</p>
<p>Images are compressed by representing how much of each color is present in each pixel. Videos are similar as they are just frames of images in a sequence. For example, if compression was not used in YouTube videos then it would take almost two minutes to load a second of the video. Image compression also exploits the limitations of the eye. An image can be compressed to 1% of its original size and still be completely recognisable. This is because compression methods know how the human eye works and aim to satisfy it. Compression and decompression are becoming quicker and more effective because of improvements in computer hardware. Compression is essential for many computer functions – without it things would take a hell of a lot longer to do!</p>
<p>Databases play a big role in Computer Science. Our lecture on Spatial Information Systems (SIS) gave us an insight into databases and how they can be used to store vast amounts of information and to save time. Data and information are important in Computer Science. Data overload is an increasing problem because of the accumulation of data on servers and computers. A database system provides efficient, reliable, convenient and safe multi-user storage of and access to massive amounts of persistent data. The idea is that can you search a lot of data and easily extract only the data that you want. Here are some examples of databases: websites storing users information; database of student grades – university data; bank databases (payroll information, customers etc.). One thing is for sure – there is a lot of money in the database (DB) industry. In 2006, DB revenue was $15.2 billion, and it’s still increasing.</p>
<p>A Database Management System (DBMS) is a piece of software that interacts with the DB and the user application programs that use the data stored in the DB. An example of a database is Amazon – an online bookseller. This system collects all sorts of information about the users and stores it in a database. It would be inefficient for the site to load all of the information on every page load, so the database splits up the information and loads only the relevant data. Data is the raw facts to be interpreted and correlated in order to provide information. Relational databases store information in columns. Most databases use this relational model to access information efficiently.</p>
<p>The Structured Query Language (SQL) is the standard DB language. This language is not necessary using a GUI such as Microsoft Access or equivalent programs. GUIs require the user to have little or no knowledge of database theory, therefore inconsistency is common among Access databases. Duplicates are an inconsistency as a table with a duplicate entry may return incorrect information. There are methods of avoiding inconsistencies, which we will study next year.</p>
<p>Spatial data is becoming increasingly important these days. <em>‘Also known as </em><em>geospatial data</em><em> or </em><em>geographic information</em><em> it is the data or information that identifies the geographic location of features and boundaries on Earth, such as natural or constructed features, oceans, and more.’ [</em><span style="text-decoration: underline;"><a href="http://www.webopedia.com/TERM/S/spatial_data.html">http://www.webopedia.com/TERM/S/spatial_data.html</a></span><em>]</em>. This data is usually stored as coordinates or as vectors. Spatial Data plays a massive role in data overload. For example, NASA’s Earth Observation System generates one terabyte of data every day. Companies such as Google Maps and the volunteering organisation OpenStreetMap also contribute to this problem. In fact, over 80% of all data on earth has a spatial component. More and more available data is being linked to location and more people are becoming interested in this. Organisations and companies are increasingly trying to establish where most of their customers come from and they are exploiting this information to do so. Google Earth is an example of an application using spatial data. Its API is open source, which allows people to access its information and interact with it. Spatial queries require complex algorithms to work and to select specific information from databases. Companies currently developing spatial applications are: MapFlow, e-Spatial, ESRI, Oracle, Google.</p>
<p>After considering all of these topics among others that we have studied, I think I have a better idea of what it means to be a computer scientist. I have also learned a great deal about what paths I can take into the industry – the choices are vast. Computer scientists are people who diagnose and solve problems, test, think and program. They must understand the technicalities of computers but have the ability to communicate them in a non-technical way. In conclusion, the essence of Computer Science is thinking outside the box.</p>
]]></content:encoded>
			<wfw:commentRss>http://conor.macaoidh.ie/blog/2010/12/10/the-essence-of-computer-science/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C rsync Program</title>
		<link>http://conor.macaoidh.ie/blog/2010/11/26/c-rsync-program/</link>
		<comments>http://conor.macaoidh.ie/blog/2010/11/26/c-rsync-program/#comments</comments>
		<pubDate>Fri, 26 Nov 2010 14:30:03 +0000</pubDate>
		<dc:creator><![CDATA[Conor]]></dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[College]]></category>
		<category><![CDATA[Languages]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[copy]]></category>
		<category><![CDATA[destination]]></category>
		<category><![CDATA[program]]></category>
		<category><![CDATA[rsyc]]></category>
		<category><![CDATA[source]]></category>

		<guid isPermaLink="false">http://blog.macaoidh.name/?p=405</guid>
		<description><![CDATA[An improvement on the previous post about a copy program in C. This program is more similar to rsync &#8211; it checks if the file exists and only copies chars that are different thus reducing compute time ( hopefully! ). /** * rsync.c * * copys a file to a different location - only * [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>An improvement on the previous post about a copy program in C. This program is more similar to rsync &#8211; it checks if the file exists and only copies chars that are different thus reducing compute time ( hopefully! ).</p>
<pre class="brush: php">/**
 * rsync.c
 *
 * copys a file to a different location - only
 * copys nessecary chars
 *
 * @author     Conor Mac Aoidh &lt;conormacaoidh@gmail.com&gt;
 * @version    1.0
 */

#include &lt;stdio.h&gt;

/**
 * main
 *
 * main function
 */
int main( int argc, char *argv[ ] ){

 FILE *fopen( ), *source, *destination, *exists;
 int c;

 source = fopen( argv[ 1 ], "r" );
 destination = fopen( argv[ 2 ], "wt" );

 if( argc != 3 ){
   printf( "Please supply arguments in the form:\ncopy &lt;source&gt; &lt;destination&gt;\n" );
   return 1;
 }

 if( source == NULL ){
   printf( "Could not open &lt;%s&gt; for reading.\n", argv[ 1 ] );
   return 1;
 }
 else if( destination == NULL ){
   printf( "Could not open &lt;%s&gt; for writing.\n", argv[ 2 ] );
   return 1;
 }

/**
 * check if destination file exists already
 */
 if ( exists = fopen( argv[ 2 ], "r") ){
   /**
    * destination file exists so compare files
    * only copying whats nessecary
    */
    int s;

    c = getc( source );
    s = getc( exists );

    while( c != EOF ){

       if( c == s ){
          c = getc( source );
          s = getc( exists );
          continue;
       }
       else{
          putc( c, destination );
          c = getc( source );
          s = getc( exists );
       }
    }
 }
 else{
    /**
     * file does not exist so copy char for char
     */
    c = getc( source );

    while( c != EOF ){
       putc( c, destination );
       c = getc( source );
    }
 }
}
</pre>
<p>Doing Perl next week.. can&#8217;t wait! A chance to actually understand regex!</p>
]]></content:encoded>
			<wfw:commentRss>http://conor.macaoidh.ie/blog/2010/11/26/c-rsync-program/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C Copy Program</title>
		<link>http://conor.macaoidh.ie/blog/2010/11/26/c-copy-program/</link>
		<comments>http://conor.macaoidh.ie/blog/2010/11/26/c-copy-program/#comments</comments>
		<pubDate>Fri, 26 Nov 2010 13:49:08 +0000</pubDate>
		<dc:creator><![CDATA[Conor]]></dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[College]]></category>
		<category><![CDATA[Languages]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[copy]]></category>
		<category><![CDATA[destination]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[program]]></category>
		<category><![CDATA[source]]></category>

		<guid isPermaLink="false">http://blog.macaoidh.name/?p=401</guid>
		<description><![CDATA[Wrote a quick program in C today which basically does the same thing as the UNIX cp command and the copy command on DOS. Thought I&#8217;d post it since I haven&#8217;t posted anything in a while! /** * copy.c * * copys a file to a different location * * @author     Conor Mac Aoidh &#60;conormacaoidh@gmail.com&#62; [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Wrote a quick program in C today which basically does the same thing as the UNIX cp command and the copy command on DOS. Thought I&#8217;d post it since I haven&#8217;t posted anything in a while!</p>
<pre class="brush:php">/**
 * copy.c
 *
 * copys a file to a different location
 *
 * @author     Conor Mac Aoidh &lt;conormacaoidh@gmail.com&gt;
 * @version    1.0
 */

#include &lt;stdio.h&gt;

/**
 * main
 *
 * main function 
 */
void main( int argc, char *argv[ ] ){

 FILE *fopen( ), *source, *destination;
 int c;

 source = fopen( argv[ 1 ], "r" );
 destination = fopen( argv[ 2 ], "wt" );

 if( argc != 3 ){
   printf( "Please supply arguments in the form:\ncopy &lt;source&gt; &lt;destination&gt;\n" );
   exit( 1 );
 }

 if( source == NULL ){
   printf( "Could not open &lt;%s&gt; for reading.\n", argv[ 1 ] );
   exit( 1 );
 }
 else if( destination == NULL ){
   printf( "Could not open &lt;%s&gt; for writing.\n", argv[ 2 ] );
   exit( 1 );
 }

 c = getc( source );
 while( c != EOF ){
   putc( c, destination );
   c = getc( source );
 }

}</pre>
]]></content:encoded>
			<wfw:commentRss>http://conor.macaoidh.ie/blog/2010/11/26/c-copy-program/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery UI Sortable &#8211; Save Position and Open/Close</title>
		<link>http://conor.macaoidh.ie/blog/2010/09/02/jquery-ui-sortable-save-position-and-openclose/</link>
		<comments>http://conor.macaoidh.ie/blog/2010/09/02/jquery-ui-sortable-save-position-and-openclose/#comments</comments>
		<pubDate>Thu, 02 Sep 2010 12:38:10 +0000</pubDate>
		<dc:creator><![CDATA[Conor]]></dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Languages]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[close]]></category>
		<category><![CDATA[dashboard]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[divs]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jquery ui]]></category>
		<category><![CDATA[open]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[position]]></category>
		<category><![CDATA[save]]></category>
		<category><![CDATA[save position]]></category>
		<category><![CDATA[save status]]></category>
		<category><![CDATA[sortable]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.macaoidh.name/?p=383</guid>
		<description><![CDATA[I wrote a bit for the Furasta.Org overview page yesterday. I decided to share what I wrote (re-written independent from Furasta.Org) because when writing it I couldn&#8217;t find anything online documenting it. I know there are things like this &#8211; WordPress&#8217;s Dashboard is one example &#8211; but it didn&#8217;t seem to be documented anywhere. Demo [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I wrote a bit for the <a href="http://Furasta.Org">Furasta.Org</a> overview page yesterday. I decided to share what I wrote (re-written independent from <a href="http://Furasta.Org">Furasta.Org</a>) because when writing it I couldn&#8217;t find anything online documenting it. I know there are things like this &#8211; WordPress&#8217;s Dashboard is one example &#8211; but it didn&#8217;t seem to be documented anywhere.</p>
<h2><a title="Demo" href="http://files.macaoidh.name/demos/jquery-ui-sortable/">Demo</a></h2>
<h2><a title="Download Example" href="http://files.macaoidh.name/Download/jquery-ui-sortable-example">Download Example</a></h2>
<p>I&#8217;m not going to go into the details of how it&#8217;s done. If you download the well documented example, you should be able to figure out how it works. Any suggestions for improvement are welcome.</p>
<p>This example is somewhat different from how it is actually done in <a href="http://Furasta.Org">Furasta.Org</a>, where I use the caching system to store files based on the user&#8217;s id insuring that each user can have their own separate configuration. The key difference, noted in the documentation, is that in <a href="http://Furasta.Org">Furasta.Org</a> I don&#8217;t know how many divs need sorting because the plugin architecture has access to what I have called &#8216;Overview Items&#8217;. So to deal with that issue I created a class to deal with the items, which is visible <a href="http://code.google.com/p/furasta-org/source/browse/trunk/_inc/class/OverviewItems.php">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://conor.macaoidh.ie/blog/2010/09/02/jquery-ui-sortable-save-position-and-openclose/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
