<?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>The Periodic Something Else</title>
	<atom:link href="http://www.fergalmoran.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fergalmoran.com</link>
	<description>::Fergal Moran&#039;s Webpage::</description>
	<lastBuildDate>Thu, 04 Aug 2011 12:20:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Percentage widths in Android</title>
		<link>http://www.fergalmoran.com/2011/06/percentage-widths-in-android/</link>
		<comments>http://www.fergalmoran.com/2011/06/percentage-widths-in-android/#comments</comments>
		<pubDate>Mon, 06 Jun 2011 18:39:55 +0000</pubDate>
		<dc:creator>Fergal</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[LinearLayout]]></category>
		<category><![CDATA[percentage width]]></category>
		<category><![CDATA[sdk]]></category>

		<guid isPermaLink="false">http://www.fergalmoran.com/?p=440</guid>
		<description><![CDATA[Here&#8217;s one that was bugging me for ages, setting the width child items of a horizontal LinearLayout using percentages without 10/15 minutes of trial and error. Set the weightSum of the layout to 100 and the layout_width of each of the the children to 0px then you can set the layout_weight attribute of each of [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s one that was bugging me for ages, setting the width child items of a horizontal LinearLayout using percentages without 10/15 minutes of trial and error.<br />
Set the weightSum of the layout to 100 and the layout_width of each of the the children to 0px then you can set the  layout_weight attribute of each of the children to the percentage width you want  them to have. Shaboom!</p>
<pre class="brush: xml; title: ; notranslate">&lt;LinearLayout
	android:orientation=&quot;horizontal&quot;
	android:id=&quot;@+id/toprow&quot;
	android:weightSum=&quot;100&quot;
	android:layout_width=&quot;fill_parent&quot;
	android:layout_height=&quot;wrap_content&quot;&gt;
		&lt;TextView
		  android:id=&quot;@+id/text1&quot;
			android:layout_width=&quot;0px&quot;
			android:layout_weight=&quot;80&quot;
			android:layout_height=&quot;wrap_content&quot;/&gt;
		&lt;TextView android:id=&quot;@+id/custom_property&quot;
			android:layout_width=&quot;0px&quot;
			android:layout_weight=&quot;20&quot;
			android:layout_height=&quot;wrap_content&quot;/&gt;
&lt;/LinearLayout&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.fergalmoran.com/2011/06/percentage-widths-in-android/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>What gay marriage means..</title>
		<link>http://www.fergalmoran.com/2011/04/what-gay-marriage-means/</link>
		<comments>http://www.fergalmoran.com/2011/04/what-gay-marriage-means/#comments</comments>
		<pubDate>Mon, 04 Apr 2011 10:47:46 +0000</pubDate>
		<dc:creator>Fergal</dc:creator>
				<category><![CDATA[Humour]]></category>
		<category><![CDATA[Religion]]></category>

		<guid isPermaLink="false">http://www.fergalmoran.com/?p=432</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.fergalmoran.com/wp-content/uploads/2011/04/gaymarrying.png"><img class="aligncenter size-full wp-image-433" title="gaymarrying" src="http://www.fergalmoran.com/wp-content/uploads/2011/04/gaymarrying.png" alt="" width="450" height="650" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.fergalmoran.com/2011/04/what-gay-marriage-means/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Realists</title>
		<link>http://www.fergalmoran.com/2011/03/realists/</link>
		<comments>http://www.fergalmoran.com/2011/03/realists/#comments</comments>
		<pubDate>Fri, 18 Mar 2011 10:14:30 +0000</pubDate>
		<dc:creator>Fergal</dc:creator>
				<category><![CDATA[Humour]]></category>

		<guid isPermaLink="false">http://www.fergalmoran.com/?p=423</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.fergalmoran.com/wp-content/uploads/2011/03/200674_10150431681865214_730005213_17746892_4089614_n.jpg"><img class="aligncenter size-full wp-image-424" title="200674_10150431681865214_730005213_17746892_4089614_n" src="http://www.fergalmoran.com/wp-content/uploads/2011/03/200674_10150431681865214_730005213_17746892_4089614_n.jpg" alt="Realists" width="640" height="589" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.fergalmoran.com/2011/03/realists/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generating QR Codes containing vCard data</title>
		<link>http://www.fergalmoran.com/2011/01/generating-qr-codes-containing-vcard-data/</link>
		<comments>http://www.fergalmoran.com/2011/01/generating-qr-codes-containing-vcard-data/#comments</comments>
		<pubDate>Fri, 07 Jan 2011 17:52:53 +0000</pubDate>
		<dc:creator>Fergal</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[bottle]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[qr-code]]></category>
		<category><![CDATA[vcard]]></category>

		<guid isPermaLink="false">http://www.fergalmoran.com/?p=406</guid>
		<description><![CDATA[Generating QR Codes containing vCard data]]></description>
			<content:encoded><![CDATA[<p>2011 will be the year of the <a href="http://en.wikipedia.org/wiki/QR_Code">QR-Code</a> of this I am sure..</p>
<p>In brief, they&#8217;re fascinating little 2-dimensional barcodes that can be used to encode up to 2,953 bytes of data. The android app store uses them to encode links to applications, you scan the QR-code and the device pops up a link to the app store for your to download&#8230;.. Hence my interest!!</p>
<p>I wanted to figure out how to generate these so I decided that combining some of my recent interests (wordpress plugin development and google app engine) and knocking up something to generate QR-codes containing vCard information would be fun and useful.</p>
<p>I&#8217;m not going to go into much detail as the source is available and I&#8217;m terminally lazy when it comes to explaining code. I used bottle.py as the REST framework (plan on moving it up to GAE, yaml file is there already but because GAE doesn&#8217;t have a persistent file system, it&#8217;s non trivial to do the permalink) and Uni-Form for the client. Code to generate the QR used pygooglechart and was trivial</p>
<pre class="brush: python; title: ; notranslate">from pygooglechart import QRChart
import re
import uuid
import shutil
import os

HEIGHT = 210
WIDTH  = 210

vCardTemplate = '''BEGIN:VCARD
N:{SURNAME};{FIRSTNAME}
TEL;CELL:{TELMOBILE}
TEL;HOME:{TELHOME}
EMAIL:{EMAIL}
URL:{URL}
END:VCARD'''

class QRMaker:
    def __init__(self):
        self._templateData = vCardTemplate

    def createVCard(self, data):
        try:
                chart = QRChart(HEIGHT, WIDTH)
                templateData = ''
                for k, v in data.items():
                    templateData = self._templateData.replace('{%s}' % k, v)
                    self._templateData = templateData

                match = re.sub(r'{\w*\w}', '', templateData)

                chart.add_data(match)
                chart.set_ec('H', 0)
                uid = uuid.uuid1()
                filePath =  '%s/../static/cache/%s.png' % (os.path.dirname(__file__), uid)
                chart.download(filePath)
                return uid
        except ex:
                logging.debug('Unhandled exception')
                logging.exception('Unhandled exception')

    def generatePermalink(self, id):
        shutil.copyfile(
            'static/cache/%s.png' % id,
            'static/images/permalinked/%s.png' % id
        )
        return 'static/images/permalinked/%s.png' % id
</pre>
<p>Part one of this is to generate the QR-codes and is working (for loose values of work) below</p>
<p>Part two will be to extend it to allow a wordpress plugin to display this QR-code on your site.</p>
<p>:: Demo app is available <a href="http://services.fergalmoran.com/qrmaker/" rel="external nofollow">here </a> <br />
:: Source is available <a href="https://github.com/fergalmoran/qrmaker">here</a></p>
<h1>::Update::</h1>
<p>I&#8217;m having mixed success scanning the generate QR-code using a HTC Desire. It seems the more data I add to the QR-code the less accurate it is scanning, despite <a href="http://zxing.org/w/decode.jspx" rel="external nofollow">zxing</a> reading it fine. I&#8217;m happy enough though that it&#8217;s a valid QR-code and won&#8217;t be doing any more work on this side of things unless I hear different, so do let me know your results..</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fergalmoran.com/2011/01/generating-qr-codes-containing-vcard-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why cats &gt; dogs</title>
		<link>http://www.fergalmoran.com/2011/01/why-cats-dogs/</link>
		<comments>http://www.fergalmoran.com/2011/01/why-cats-dogs/#comments</comments>
		<pubDate>Fri, 07 Jan 2011 17:49:33 +0000</pubDate>
		<dc:creator>Fergal</dc:creator>
				<category><![CDATA[Humour]]></category>

		<guid isPermaLink="false">http://www.fergalmoran.com/?p=403</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.fergalmoran.com/wp-content/uploads/2011/01/l.gif"><img src="http://www.fergalmoran.com/wp-content/uploads/2011/01/l.gif" alt="" title="Why cats &gt; dogs" width="307" height="244" class="aligncenter size-full wp-image-404" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.fergalmoran.com/2011/01/why-cats-dogs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>System.BadImageFormatException</title>
		<link>http://www.fergalmoran.com/2010/12/system-badimageformatexception/</link>
		<comments>http://www.fergalmoran.com/2010/12/system-badimageformatexception/#comments</comments>
		<pubDate>Mon, 06 Dec 2010 13:40:45 +0000</pubDate>
		<dc:creator>Fergal</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.fergalmoran.com/?p=393</guid>
		<description><![CDATA[Kept getting this recently when debugging an IIS application on 64 bit windows 7. Problem was I had explicitly set all the projects in the solution to x32 but IIS was running in 64 bit mode. Just go into the advanced settings of the Application Pool and enable 32 bit&#8230;]]></description>
			<content:encoded><![CDATA[<p>Kept getting this recently when debugging an IIS application on 64 bit windows 7.<br />
Problem was I had explicitly set all the projects in the solution to x32 but IIS was running in 64 bit mode. Just go into the advanced settings of the Application Pool and enable 32 bit&#8230;</p>
<p><a href="http://www.fergalmoran.com/wp-content/uploads/2010/11/IIS_AppPool.png"><img src="http://www.fergalmoran.com/wp-content/uploads/2010/11/IIS_AppPool.png" alt="" title="IIS_AppPool" width="908" height="541" class="aligncenter size-full wp-image-394" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.fergalmoran.com/2010/12/system-badimageformatexception/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stephen Fry on Language</title>
		<link>http://www.fergalmoran.com/2010/10/stephen-fry-on-language/</link>
		<comments>http://www.fergalmoran.com/2010/10/stephen-fry-on-language/#comments</comments>
		<pubDate>Thu, 14 Oct 2010 08:54:19 +0000</pubDate>
		<dc:creator>Fergal</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.fergalmoran.com/?p=386</guid>
		<description><![CDATA[Stephen Fry is God &#8211; FACT!]]></description>
			<content:encoded><![CDATA[<p>Stephen Fry is God &#8211; FACT!</p>
<p><object width="640" height="390"><param name="movie" value="http://www.youtube.com/v/J7E-aoXLZGY&#038;hl=en_GB&#038;feature=player_embedded&#038;version=3"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.youtube.com/v/J7E-aoXLZGY&#038;hl=en_GB&#038;feature=player_embedded&#038;version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="390"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.fergalmoran.com/2010/10/stephen-fry-on-language/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Synthesizer club (synth geeks only)</title>
		<link>http://www.fergalmoran.com/2010/08/synthesizer-club-synth-geeks-only/</link>
		<comments>http://www.fergalmoran.com/2010/08/synthesizer-club-synth-geeks-only/#comments</comments>
		<pubDate>Tue, 31 Aug 2010 20:11:18 +0000</pubDate>
		<dc:creator>Fergal</dc:creator>
				<category><![CDATA[Humour]]></category>
		<category><![CDATA[Music]]></category>

		<guid isPermaLink="false">http://www.fergalmoran.com/?p=358</guid>
		<description><![CDATA[Thanks to Shane @fishgodeep for putting me on to these, sheer genius&#8230; &#8220;When I want a long delay I think of Margaret Thatcher.&#8221;]]></description>
			<content:encoded><![CDATA[<p>Thanks to Shane @fishgodeep for putting me on to these, sheer genius&#8230;<br />
&#8220;When I want a long delay I think of Margaret Thatcher.&#8221;<br />
<object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/A0IHhs4XvOo&#038;rel=0&#038;color1=0xb1b1b1&#038;color2=0xd0d0d0&#038;hl=en_US&#038;feature=player_embedded&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.youtube.com/v/A0IHhs4XvOo&#038;rel=0&#038;color1=0xb1b1b1&#038;color2=0xd0d0d0&#038;hl=en_US&#038;feature=player_embedded&#038;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="385"></embed></object></p>
<p><object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/dne2sR4_N8s&#038;rel=0&#038;color1=0xb1b1b1&#038;color2=0xd0d0d0&#038;hl=en_US&#038;feature=player_embedded&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.youtube.com/v/dne2sR4_N8s&#038;rel=0&#038;color1=0xb1b1b1&#038;color2=0xd0d0d0&#038;hl=en_US&#038;feature=player_embedded&#038;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="385"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.fergalmoran.com/2010/08/synthesizer-club-synth-geeks-only/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Idiots guide to exporting X to cygwin</title>
		<link>http://www.fergalmoran.com/2010/08/idiots-guide-to-exporting-x-to-cygwin/</link>
		<comments>http://www.fergalmoran.com/2010/08/idiots-guide-to-exporting-x-to-cygwin/#comments</comments>
		<pubDate>Mon, 30 Aug 2010 15:08:11 +0000</pubDate>
		<dc:creator>Fergal</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[cygwin]]></category>
		<category><![CDATA[exporting display]]></category>
		<category><![CDATA[x client]]></category>
		<category><![CDATA[x server]]></category>

		<guid isPermaLink="false">http://www.fergalmoran.com/?p=351</guid>
		<description><![CDATA[Idiots guide to exporting X to cygwin]]></description>
			<content:encoded><![CDATA[<p>Forget how to do this every time&#8230; So here&#8217;s the idiots guide..</p>
<p>Install cygwin and check all the X&#8217; stuff (I usually just select xterm and let dependency checks do the rest).</p>
<p>run <cygwin-dir>\bin\xwin.exe -multiwindow</p>
<p>Open a putty session, make sure that in Connection\SSH\X11<br />
     Enable X11 forwarding is ticked and<br />
     X display location is set to IP/hostname of box<br />
<a href="http://www.fergalmoran.com/wp-content/uploads/2010/08/putty-x11-settings.png"><img src="http://www.fergalmoran.com/wp-content/uploads/2010/08/putty-x11-settings.png" alt="" title="putty-x11-settings" width="459" height="400" class="aligncenter size-full wp-image-353" /></a></p>
<p>Log unto your nix box and try running an xterm&#8230;<br />
<a href="http://www.fergalmoran.com/wp-content/uploads/2010/08/awesome-pants.png" rel="external nofollow"><img src="http://www.fergalmoran.com/wp-content/uploads/2010/08/awesome-pants.png" alt="" title="awesome-pants" width="673" height="384" class="aligncenter size-full wp-image-355" /></a><br />
Put on your awesome pants (or not)..</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fergalmoran.com/2010/08/idiots-guide-to-exporting-x-to-cygwin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Magnetic Fields &#8211; All My Little Words</title>
		<link>http://www.fergalmoran.com/2010/08/the-magnetic-fields-all-my-little-words/</link>
		<comments>http://www.fergalmoran.com/2010/08/the-magnetic-fields-all-my-little-words/#comments</comments>
		<pubDate>Sat, 28 Aug 2010 02:44:00 +0000</pubDate>
		<dc:creator>Fergal</dc:creator>
				<category><![CDATA[Music]]></category>
		<category><![CDATA[all my little words]]></category>
		<category><![CDATA[magnetic fields]]></category>
		<category><![CDATA[Unboyfriendable]]></category>

		<guid isPermaLink="false">http://www.fergalmoran.com/?p=348</guid>
		<description><![CDATA[My brain broke for a year &#8211; and I forgot how much I love this tune&#8230; Unboyfriendable is again my favourite word..]]></description>
			<content:encoded><![CDATA[<p>My brain broke for a year &#8211; and I forgot how much I love this tune&#8230; Unboyfriendable is again my favourite word..</p>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/eo8vW_0H_Kg?fs=1&amp;hl=en_GB"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/eo8vW_0H_Kg?fs=1&amp;hl=en_GB" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.fergalmoran.com/2010/08/the-magnetic-fields-all-my-little-words/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

