<?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>Jamie McDonald</title>
	<atom:link href="http://www.qwyck.co.uk/feed" rel="self" type="application/rss+xml" />
	<link>http://www.qwyck.co.uk</link>
	<description>graduate, devourer of books and climber of rocks</description>
	<lastBuildDate>Fri, 09 Dec 2011 13:51:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>What am I up to?</title>
		<link>http://www.qwyck.co.uk/2011/what-am-i-up-to?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=what-am-i-up-to</link>
		<comments>http://www.qwyck.co.uk/2011/what-am-i-up-to#comments</comments>
		<pubDate>Mon, 05 Dec 2011 18:11:04 +0000</pubDate>
		<dc:creator>Jamie McDonald</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[battlefield]]></category>
		<category><![CDATA[battlelog]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://www.qwyck.co.uk/?p=58</guid>
		<description><![CDATA[In recent months I have been doing many things. Mainly I&#8217;ve been keeping busy and not having anything to write about. Since I graduated in July I&#8217;ve worked at Rail Vision in Loughborough developing application interfaces in Visual C#; I have moved house and I finally started my new job and life at IBM. For [...]]]></description>
			<content:encoded><![CDATA[<p>In recent months I have been doing many things. Mainly I&#8217;ve been keeping busy and not having anything to write about.</p>
<p>Since I graduated in July I&#8217;ve worked at Rail Vision in Loughborough developing application interfaces in Visual C#; I have moved house and I finally started my new job and life at IBM.</p>
<p>For the past few weeks I&#8217;ve been orienting myself to the IBM way of life, getting used to the people and the software/hardware I will be working with and things that I might be working with one day. Hopefully all this learning I&#8217;ve been doing will be useful when I actually get to start working on a project, but until then I&#8217;m excited for what the future holds.</p>
<p>In other news, I recently started playing Battlefield 3 with some friends. As <a href="http://lucumr.pocoo.org/2011/11/15/modern-web-applications-are-here/" title="Battlelog: Modern Web Applications Are Here" target="_blank">Armin Ronacher</a> points describes, the Battlelog web application which records your statistics, launches single and multiplayer games and much more; is actually a really interesting platform. I&#8217;ve been looking for an excuse to build a Ruby on Rails application and learn Ruby/Rails for a long time now and so I have set about working on a Ruby gem for parsing JSON data from the Battlelog website and an example RoR app to demonstrate some functionality.</p>
<p>Before starting I looked around for any similar projects and found some work by <a href="http://www.blakeharley.com/projects/battlelogapi/" title="PHP Battlelog API by Blake Harley" target="_blank">Blake Harley</a>, who has written a PHP API for Battlelog. It is this work which I have based my Ruby code on.</p>
<p>The current work-in-progress can be found on <a href="https://github.com/jrmcdonald/battlelog_parser" title="battlelog_api on github" target="_blank">github</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.qwyck.co.uk/2011/what-am-i-up-to/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Decrypting the XECryption Algorithm</title>
		<link>http://www.qwyck.co.uk/2011/decrypting-xecryption-algorithm?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=decrypting-xecryption-algorithm</link>
		<comments>http://www.qwyck.co.uk/2011/decrypting-xecryption-algorithm#comments</comments>
		<pubDate>Sat, 18 Jun 2011 20:16:46 +0000</pubDate>
		<dc:creator>Jamie McDonald</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[cryptography]]></category>
		<category><![CDATA[decryption]]></category>
		<category><![CDATA[hack this site]]></category>
		<category><![CDATA[hackthissite]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[xecryption]]></category>

		<guid isPermaLink="false">http://www.qwyck.co.uk/?p=42</guid>
		<description><![CDATA[I&#8217;ve been going through the Hack This Site challenges and found the sixth realistic mission to be good fun. The challenge was to take an email encrypted using the XECryption and decrypt it. A little background knowledge on the algorithm was required to understand how to decrypt it. The secret key for XECryption is created [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been going through the <a title="Hack This Site" href="http://www.hackthissite.org" target="_blank">Hack This Site</a> challenges and found the sixth realistic mission to be good fun. The challenge was to take an email encrypted using the XECryption and decrypt it. A little background knowledge on the algorithm was required to understand how to decrypt it.</p>
<p>The secret key for XECryption is created by taking each character of the password, converting them to their ASCII code equivalents and summing them together. Each character is encrypted by converting it to it&#8217;s ASCII code equivalent and then adding the value of the key to it. It is then divided into three three-digit numbers separated by a full-stop each. So as an example we will use the secret key &#8220;hello&#8221; and the letter &#8220;s&#8221; as a message:</p>
<p>hello = 104 + 101 + 108 + 108 + 111 = 532</p>
<p>s + 532 = 115 + 532 = 647</p>
<p>ciphertext = .214.265.263.</p>
<p>XECryption can easily be decrypted with the secret key by taking the sum of the three digits, minus the secret key and convert the value from an ASCII code to the character.</p>
<p>Knowing this information is useful but without the secret key we have to do some analysis on the ciphertext. By grouping the text into the sets of 3 numbers and finding their sums it is possible to do some frequency analysis on the ciphertext. According to studies, the most frequent letter in the alphabet is &#8220;e&#8221; however given the modern context of the scenario the most common character is likely to be a space. If you take the value of the most common character and subtract 32 (the ASCII code of a space character) you have a possible candidate for a key. The only thing left to do is to subtract the key from each of the three digit groupings and convert them from the ASCII codes to the character equivalents. If the most common character turned out not to be a space then other characters would have to be tried.</p>
<p>Being lazy, I wrote a script in Python to do this. However, I only learnt Python today so it might be inefficient or horribly coded, but it works and got me my solution to the challenge.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/env python</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Open the encrypted file</span>
<span style="color: #008000;">file</span> = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;cipher.txt&quot;</span>, <span style="color: #483d8b;">&quot;r&quot;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Read the file and split the numbers into a list</span>
ciphertext = <span style="color: #008000;">file</span>.<span style="color: black;">read</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">replace</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;.&quot;</span>,<span style="color: #483d8b;">&quot; &quot;</span><span style="color: black;">&#41;</span>.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
z = <span style="color: #ff4500;">0</span>
&nbsp;
L = <span style="color: #008000;">list</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Group the numbers into blocks of 3 and sum them</span>
<span style="color: #ff7700;font-weight:bold;">for</span> i, x <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">enumerate</span><span style="color: black;">&#40;</span>ciphertext<span style="color: black;">&#41;</span>:
	<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#40;</span>i <span style="color: #66cc66;">!</span>= <span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span> <span style="color: #66cc66;">&amp;</span> <span style="color: black;">&#40;</span><span style="color: black;">&#40;</span>i <span style="color: #66cc66;">%</span> <span style="color: #ff4500;">3</span><span style="color: black;">&#41;</span> == <span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span>:
		z += <span style="color: #ff4500;">1</span>
	<span style="color: #ff7700;font-weight:bold;">try</span>:
		L<span style="color: black;">&#91;</span>z<span style="color: black;">&#93;</span> += <span style="color: #008000;">int</span><span style="color: black;">&#40;</span>x<span style="color: black;">&#41;</span>
	<span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">IndexError</span>:
		L.<span style="color: black;">append</span><span style="color: black;">&#40;</span><span style="color: #008000;">int</span><span style="color: black;">&#40;</span>x<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Find the most common element and subtract 32 (ascii value of space) to get the key</span>
key = <span style="color: #008000;">max</span><span style="color: black;">&#40;</span><span style="color: #008000;">set</span><span style="color: black;">&#40;</span>L<span style="color: black;">&#41;</span>, key=L.<span style="color: black;">count</span><span style="color: black;">&#41;</span> - <span style="color: #ff4500;">32</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Subtract key from each value and convert from it's ascii value to its character form</span>
<span style="color: #ff7700;font-weight:bold;">for</span> i,x <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">enumerate</span><span style="color: black;">&#40;</span>L<span style="color: black;">&#41;</span>:
	<span style="color: #808080; font-style: italic;"># print i, x, x - key</span>
	L<span style="color: black;">&#91;</span>i<span style="color: black;">&#93;</span> = <span style="color: #008000;">chr</span><span style="color: black;">&#40;</span>x - key<span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Print the decrypted text</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;&quot;</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span>L<span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>After doing this, and when writing up this post, I discovered that there already exist solutions in Python and other languages for this that are probably better, but this was much more fun <img src='http://www.qwyck.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.qwyck.co.uk/2011/decrypting-xecryption-algorithm/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installing Player/Stage on Mac OS X</title>
		<link>http://www.qwyck.co.uk/2011/installing-playerstage-on-mac-os-x?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=installing-playerstage-on-mac-os-x</link>
		<comments>http://www.qwyck.co.uk/2011/installing-playerstage-on-mac-os-x#comments</comments>
		<pubDate>Sun, 22 May 2011 10:00:29 +0000</pubDate>
		<dc:creator>Jamie McDonald</dc:creator>
				<category><![CDATA[Player/Stage]]></category>
		<category><![CDATA[fltk]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[mac os x]]></category>
		<category><![CDATA[player]]></category>
		<category><![CDATA[playerstage]]></category>
		<category><![CDATA[stage]]></category>

		<guid isPermaLink="false">http://www.qwyck.co.uk/?p=26</guid>
		<description><![CDATA[For me, installing Player/Stage was a bit of a nightmare. There isn&#8217;t a wealth of information about installing Player/Stage on any operating system, let alone on a Macbook Pro. I tried running an Ubuntu install in VirtualBox and using the install script on this wiki page but the script failed and I didn&#8217;t understand enough [...]]]></description>
			<content:encoded><![CDATA[<p>For me, installing Player/Stage was a bit of a nightmare. There isn&#8217;t a wealth of information about installing Player/Stage on any operating system, let alone on a Macbook Pro.</p>
<p>I tried running an Ubuntu install in VirtualBox and using the install script on <a href="http://www.control.aau.dk/~tb/wiki/index.php/Installing_Player_and_Stage_in_Ubuntu">this wiki page</a> but the script failed and I didn&#8217;t understand enough to figure out what went wrong (I don&#8217;t think I would understand any better now!). I then tried using the package manager to install the Debian/Ubuntu packages but I got lots of errors about missing models and drivers. That&#8217;s when I gave up on Ubuntu.</p>
<p>MacPorts seemed to offer a golden solution, however after running the install for hours on end to have the process throw an error and fail numerous times made me give up on that avenue. Then, I found some magical instructions on <a href="http://sublimated.wordpress.com/2008/05/24/playerstage-on-os-x-105-from-macports/">this website</a>. Thank you Serge Stinckwich. I&#8217;m not sure whether it was these instructions alone, or the combination of those and the attempts with MacPorts however I have a working installation of Player/Stage on Mac OS X 10.6.7. For the sake of my paranoia about things that may someday disappear on the internet, I&#8217;m reposting the instructions here, but full credit goes to the original poster.</p>
<h2>How to install Player/Stage 3 on Mac OS X</h2>
<p>Install MacPorts packages: cmake, pkg-config</p>
<p>Set INSTALL_DIR to the appropriate directory. All Player/Stage tools will be installed in this directory. For example: export INSTALL_DIR=/Users/username/playerstage3</p>
<h3>Player 3.0.1 installation</h3>
<pre>cd</pre>
<pre>mkdir $INSTALL_DIR</pre>
<pre>curl -O http://nchc.dl.sourceforge.net/project/playerstage/Player/3.0.1/player-3.0.1.tar.gz</pre>
<pre>export CXXFLAGS="-arch x86_64" tar -xzvf player-3.0.1.tar.gz</pre>
<pre>cd player-3.0.1</pre>
<pre>mkdir build</pre>
<pre>cd build</pre>
<pre>cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR -DCMAKE_OSX_ARCHITECTURES=x86_64 -DBUILD_PLAYERCC_BOOST=OFF ../</pre>
<pre>make</pre>
<pre>make install</pre>
<h3>FLTK 1.3.X installation</h3>
<p>The URL below didn&#8217;t work for me, I downloaded the latest version of <a href="http://www.fltk.org">FLTK</a> at their website, which happened to be fltk-1.3.x-r8207.tar.gz at the time.</p>
<pre>cd</pre>
<pre>curl -O http://ftp.funet.fi/pub/mirrors/ftp.easysw.com/pub/fltk/snapshots/fltk-1.3.x-r7243.tar.gz</pre>
<pre>tar -xzvf fltk-1.3.x-r7243.tar.gzcd fltk-1.3.x-r7243</pre>
<pre>./configure --with-archflags="-arch x86_64" --prefix=$INSTALL_DIR</pre>
<pre>make</pre>
<pre>make install</pre>
<h3>Stage 3.2.2 installation</h3>
<pre>cd</pre>
<pre>curl -O http://nchc.dl.sourceforge.net/project/playerstage/Stage/3.2.2/Stage-3.2.2-Source.tar.gz</pre>
<pre>export PKG_CONFIG_PATH=$INSTALL_DIR/lib/pkgconfig/tar -xzvf Stage-3.2.2-Source.tar.gz</pre>
<pre>cd Stage-3.2.2-Source/</pre>
<pre>mkdir build</pre>
<pre>cd build</pre>
<pre>cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR -DCMAKE_OSX_ARCHITECTURES=x86_64 ../</pre>
<pre>make</pre>
<pre>make install</pre>
<h3>Test your P/S installation</h3>
<pre>export DYLD_LIBRARY_PATH=$INSTALL_DIR/lib/</pre>
<pre>export PATH=$INSTALL_DIR/bin:$PATH</pre>
<pre>cd</pre>
<pre>player</pre>
<pre>stage Stage-3.2.2-Source/worlds/simple.world</pre>
<pre>player Stage-3.2.2-Source/worlds/simple.cfg</pre>
<p>Hopefully, you should now have a working installation of Player/Stage! Good Luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.qwyck.co.uk/2011/installing-playerstage-on-mac-os-x/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UAV Sense and Avoid Techniques in Player/Stage</title>
		<link>http://www.qwyck.co.uk/2011/uav-sense-and-avoid-techniques?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=uav-sense-and-avoid-techniques</link>
		<comments>http://www.qwyck.co.uk/2011/uav-sense-and-avoid-techniques#comments</comments>
		<pubDate>Fri, 20 May 2011 20:57:04 +0000</pubDate>
		<dc:creator>Jamie McDonald</dc:creator>
				<category><![CDATA[Player/Stage]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[closest point of approach]]></category>
		<category><![CDATA[player]]></category>
		<category><![CDATA[playerstage]]></category>
		<category><![CDATA[potential fields]]></category>
		<category><![CDATA[sense and avoid]]></category>
		<category><![CDATA[stage]]></category>
		<category><![CDATA[uav]]></category>

		<guid isPermaLink="false">http://www.qwyck.co.uk/?p=18</guid>
		<description><![CDATA[I&#8217;ve just handed in my final year project at university (a few days ago) and I thought I would share my project as an example of what can be done in Player/Stage, I don&#8217;t think it&#8217;s particularly complex work but it could be a starting point for some more interesting work in the future. The [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just handed in my final year project at university (a few days ago) and I thought I would share my project as an example of what can be done in Player/Stage, I don&#8217;t think it&#8217;s particularly complex work but it could be a starting point for some more interesting work in the future.</p>
<p>The project was to demonstrate UAV Sense and Avoid techniques in a simulation environment and I chose to use Player/Stage. The techniques I looked into weren&#8217;t fairly complex and they aren&#8217;t as robust as I would like, maybe I will work on improving them in future, however I implemented the Closest Point of Approach and Potential Fields methods.</p>
<p>There are two parts to the code I&#8217;m including below: the Player/Stage control code for the sense and avoid techniques and some code to generate the .world, .config and main.cc files depending on the scenario. The generator code just reads an XML file and then outputs several files.</p>
<p>The code was built on OS X using Player version 3.0.1 and Stage version 3.2.2, it also requires the <a title="Boost" href="http://www.boost.org/">Boost</a> libraries. Here are some <a href="http://www.qwyck.co.uk/wp-content/uploads/2011/05/Project-Running-Instructions.pdf">running instructions</a> in PDF format that I compiled for my tutor. Here are the <a href="http://www.qwyck.co.uk/wp-content/uploads/2011/05/Jamie-McDonald-A763620-Project-Document-with-Source-Code-and-Instructions.zip">actual files</a>, the code should be fairly self explanatory however I can explain it more over an email if anyone wants to get in touch. Please bear in mind that I wrote this code whilst learning C++ so I expect there are many things that could be improved and possibly quite a few beginner&#8217;s mistakes.</p>
<p>If anyone does use this code for anything (a mention would be cool if it&#8217;s used in a significant way) or can suggest any improvements to it, email me because I&#8217;d appreciate it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.qwyck.co.uk/2011/uav-sense-and-avoid-techniques/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The First Post</title>
		<link>http://www.qwyck.co.uk/2011/the-first-post?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-first-post</link>
		<comments>http://www.qwyck.co.uk/2011/the-first-post#comments</comments>
		<pubDate>Thu, 05 May 2011 20:58:42 +0000</pubDate>
		<dc:creator>Jamie McDonald</dc:creator>
				<category><![CDATA[Player/Stage]]></category>
		<category><![CDATA[first post]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[player]]></category>
		<category><![CDATA[playerstage]]></category>
		<category><![CDATA[stage]]></category>

		<guid isPermaLink="false">http://www.qwyck.co.uk/?p=1</guid>
		<description><![CDATA[Welcome to the infamous first post. I don&#8217;t have great aspirations for this blog to be a literary masterpiece. Just a space to jot down my thoughts and things I observe. The main reason for doing this now is because I&#8217;ve finished my final year dissertation and I want to share some of the things [...]]]></description>
			<content:encoded><![CDATA[<p>Welcome to the infamous first post. I don&#8217;t have great aspirations for this blog to be a literary masterpiece. Just a space to jot down my thoughts and things I observe. The main reason for doing this now is because I&#8217;ve finished my final year dissertation and I want to share some of the things that I have learnt along the way. We&#8217;ll see where it goes from there.</p>
<p>I have an outline in my head of what the first few posts are going to be. I&#8217;ll write it down here so that I don&#8217;t forget it:</p>
<ul>
<li>Installing Player/Stage on OS X</li>
<li>Things I&#8217;ve learnt about Player/Stage</li>
<li>Various code snippets</li>
</ul>
<p>I want to test the method I used to install Player/Stage on OS X before I post any instructions. This is because I installed it several months ago and I tried so many things I&#8217;m half convinced it was a combination of several methods. Once I&#8217;ve got a fresh platform to test on I&#8217;ll write up my installation process (nightmare).</p>
<p>&lt;/firstpost&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.qwyck.co.uk/2011/the-first-post/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

