<?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>Paul Bain &#187; Paul</title>
	<atom:link href="http://www.paulbain.com/articles/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.paulbain.com</link>
	<description>Web Specialist</description>
	<lastBuildDate>Thu, 05 Nov 2009 20:54:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>EasyTube Plugin Updated</title>
		<link>http://www.paulbain.com/articles/easytube-plugin-updated/</link>
		<comments>http://www.paulbain.com/articles/easytube-plugin-updated/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 20:50:46 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.paulbain.com/?p=220</guid>
		<description><![CDATA[I've just released an update to EasyTube which is my most popular WordPress plugin which allows people to embed YouTube videos in posts and pages using a single tag.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just released an update to EasyTube which is my most popular WordPress plugin which allows people to embed YouTube videos in posts and pages using a single tag.</p>
<p><img class="aligncenter size-full wp-image-117" title="2772835176_b15688669a_b" src="http://www.paulbain.com/wp-content/uploads/2009/10/2772835176_b15688669a_b.jpg" alt="2772835176_b15688669a_b" width="620" height="298" /></p>
<h4>Version 1.7 update includes:</h4>
<ul>
<li>Multiple bug fixes including a major problem with video sizes</li>
<li>Addition of new widescreen video formats</li>
<li>Updated embed to include the fullscreen option</li>
</ul>
<p>For more information visit the <a href="http://wordpress.org/extend/plugins/easytube/">Wordpress.org</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paulbain.com/articles/easytube-plugin-updated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pay What You Want iPhone Business Model</title>
		<link>http://www.paulbain.com/articles/pay-what-you-want-iphone-business-model/</link>
		<comments>http://www.paulbain.com/articles/pay-what-you-want-iphone-business-model/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 18:00:50 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[BeerMap]]></category>
		<category><![CDATA[Business]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.paulbain.com/?p=172</guid>
		<description><![CDATA[Apple recently updated their SDK allowing developers to integrate in-app purchases into free applications opening up a whole new world of possibilities. BeerMap, one of the projects [...]]]></description>
			<content:encoded><![CDATA[<p>Apple recently updated their SDK allowing developers to integrate in-app purchases into free applications opening up a whole new world of possibilities.</p>
<p>BeerMap, one of the projects I&#8217;m currently involved with is a free iPhone app which we have always intended to monetise once it reached maturity. We&#8217;ve recently started to discuss charging in iTunes however it gave us a few concerns:</p>
<ol>
<li>The application relies on user collaboration in order to generate data, charging for the application would probably reduce the uptake by new users.</li>
<li>The application will take some time to reach maturity and is dependant on the feedback of our loyal user base.</li>
</ol>
<p>We therefore have resisted charging for the app and instead have begun to investigate other avenues.</p>
<p><img class="aligncenter size-full wp-image-177" title="162282102_ed89aa5b64_o" src="http://www.paulbain.com/wp-content/uploads/2009/10/162282102_ed89aa5b64_o.jpg" alt="162282102_ed89aa5b64_o" width="620" height="175" /></p>
<p>Last Saturday was a BeerMap development day during which we discussed the possibility of monetisation using in-app purchases and we think we may have come up with a novel solution; <strong>Pay What You Want</strong>.</p>
<p>Pay What You Want is not a new concept; in 2007 Radiohead allowed music lovers to download their new album and choose how much they want to pay. More recently 2D Boy used the same model when celebrating the first birthday of World of Goo, achieving a large number of sales and yielding a surprising profit.</p>
<p>Combining pay what you want and in-app purchase capability in BeerMap would allow users to decide whether they want to pay for the app or not! Apple provides payment tiers to which we will be limited so it won&#8217;t be 100% pay what you want, however these represent reasonable prices which users will be familiar with.</p>
<p>We plan to incentivise payment, potentially by giving the user access to extra features or awarding them recognition within the BeerMap community.</p>
<p>We hope this model will ensure we don&#8217;t scare off new users who don&#8217;t want to and will never want to pay, while providing people with the option to support the project and to show appreciation for our work.</p>
<p><em>Image credit: <strong><a href="http://www.flickr.com/photos/osterwalder/"><strong>Alex Osterwalder</strong></a></strong></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.paulbain.com/articles/pay-what-you-want-iphone-business-model/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Snow Leopard, Zend Framework and MySQLi Problem</title>
		<link>http://www.paulbain.com/articles/snow-leopard-zend-framework-and-mysqli-problem/</link>
		<comments>http://www.paulbain.com/articles/snow-leopard-zend-framework-and-mysqli-problem/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 20:54:53 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[PHP Development]]></category>
		<category><![CDATA[Snow Leopard]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://www.paulbain.com/?p=154</guid>
		<description><![CDATA[I spent a good hour banging my head against the desk this evening trying to work out why Zend Framework row objects have stopped working after upgrading to Snow Leopard and installing the new iPhone SDK [...]]]></description>
			<content:encoded><![CDATA[<p>I spent a good hour banging my head against the desk this evening trying to work out why Zend Framework row objects have stopped working after upgrading to Snow Leopard and installing the new iPhone SDK.</p>
<p><img src="http://www.paulbain.com/wp-content/uploads/2009/10/1155677_82313612.jpg" alt="1155677_82313612" title="1155677_82313612" width="620" height="254" class="aligncenter size-full wp-image-156" /></p>
<p>I traced all the way though to the Zend_Db_Statement_Mysqli class which giving the following error:</p>
<pre>Warning: Parameter 2 to mysqli_stmt::bind_param() expected to be a reference, value given in Zend/Db/Statement/Mysqli.php on line 205</pre>
<p>I was half way installing the macports PHP package when I thought I should probably try a different adapter which worked! So if you&#8217;re having difficulties, try the PDO_MYSQL driver instead.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paulbain.com/articles/snow-leopard-zend-framework-and-mysqli-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HowTO: Draggabe JFrame Without Decoration</title>
		<link>http://www.paulbain.com/articles/howto-draggabe-jframe-without-decoration/</link>
		<comments>http://www.paulbain.com/articles/howto-draggabe-jframe-without-decoration/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 10:34:25 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Java Development]]></category>
		<category><![CDATA[Efficiency]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.paulbain.com/?p=122</guid>
		<description><![CDATA[I was playing with writing a quick time tracking application called Efficiency which needed to be always ontop of other windows and therefore be a subtle as possible. I therefore decided to undecorate the window, however the user is then unable to reposition the window, so I wrote a some code to quickly allow them [...]]]></description>
			<content:encoded><![CDATA[<p>I was playing with writing a quick time tracking application called Efficiency which needed to be always ontop of other windows and therefore be a subtle as possible. I therefore decided to undecorate the window, however the user is then unable to reposition the window, so I wrote a some code to quickly allow them to do this by just dragging the JFrame.</p>
<p><img class="aligncenter size-full wp-image-129" title="coffee" src="http://www.paulbain.com/wp-content/uploads/2009/10/coffee.jpg" alt="coffee" width="620" height="302" /></p>
<p>My class extends the javax.swing.JFrame class, so I&#8217;ve set a few properties in the initComponents() function and more importantly added listeners for MousePressed and MouseDragged.</p>
<pre>    private void initComponents() {
        ...
        setAlwaysOnTop(true);
        setBackground(new java.awt.Color(0, 0, 0));
        setResizable(false);
        setUndecorated(true);
        addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                formMousePressed(evt);
            }
        });
        addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
            public void mouseDragged(java.awt.event.MouseEvent evt) {
                formMouseDragged(evt);
            }
        });
        ...
    }</pre>
<p>Firing an action on mousePressed is required to get the original location of the window. This fires the following function, setting the two variables which are of type java.awt.Point:</p>
<pre>    private void formMousePressed(java.awt.event.MouseEvent evt) {
        this.start_drag = this.getScreenLocation(evt);
        this.start_loc = this.getLocation();
    }</pre>
<p>The mouse dragged function is as follows:</p>
<pre>    private void formMouseDragged(java.awt.event.MouseEvent evt) {
            Point current = this.getScreenLocation(evt);
    Point offset = new Point((int) current.getX() - (int) start_drag.getX(),
        (int) current.getY() - (int) start_drag.getY());

    Point new_location = new Point(
        (int) (this.start_loc.getX() + offset.getX()), (int) (this.start_loc
            .getY() + offset.getY()));
        this.setLocation(new_location);
    }</pre>
<p>You&#8217;ll also need the utilty funciton to convert the points to a screen location:</p>
<pre>      Point getScreenLocation(MouseEvent e) {
        Point cursor = e.getPoint();
        Point target_location = this.getLocationOnScreen();
        return new Point((int) (target_location.getX() + cursor.getX()),
            (int) (target_location.getY() + cursor.getY()));
      }</pre>
<h3>Reference</h3>
<ul>
<li><a href="http://www.java2s.com/Code/Java/Swing-JFC/Dragandmoveaframefromitscontentarea.htm">Drag and Move</a> &#8211; material from java2s.com used as a basis but using an external MoveMouseListner class</li>
</ul>
<p><em>Photo Credit: <a title="Link to dongga BS' photostream" rel="dc:creator cc:attributionURL" href="http://www.flickr.com/photos/dongga/">dongga BS</a></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.paulbain.com/articles/howto-draggabe-jframe-without-decoration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inserting Default Content into the Wordpress Visual Editor</title>
		<link>http://www.paulbain.com/articles/inserting-default-content-into-wordpress-visual-editor/</link>
		<comments>http://www.paulbain.com/articles/inserting-default-content-into-wordpress-visual-editor/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 22:20:25 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[PHP Development]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.paulbain.com/?p=112</guid>
		<description><![CDATA[I&#8217;ve been working on a Wordpress layout which needs two columns of user editable content per page. There are many ways you could do this with Wordpress, however to make it as easy as possible for the content editors I though it would be easier if the visual editor had some default layout information inserted [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working on a Wordpress layout which needs two columns of user editable content per page. There are many ways you could do this with Wordpress, however to make it as easy as possible for the content editors I though it would be easier if the visual editor had some default layout information inserted when creating a post.</p>
<p><img class="aligncenter size-full wp-image-117" title="2772835176_b15688669a_b" src="http://www.paulbain.com/wp-content/uploads/2009/10/2772835176_b15688669a_b.jpg" alt="2772835176_b15688669a_b" width="620" height="298" /></p>
<p>I knew there must be an easy way to do this using the action API in Wordpress and I came across <a href="http://www.wprecipes.com/how-to-automatically-insert-text-in-wordpress-editor">this article</a> by WPRecipies which suggests putting the following code in the functions.php of your theme:</p>
<p><code>add_filter( 'default_content', 'my_editor_content' );<br />
function my_editor_content( $content ) {<br />
$content = "If you enjoyed this post, make sure to subscribe to my rss feed.";<br />
return $content;<br />
}</code></p>
<p>I inserted a couple of divs for the columns into mine so I also wanted to add some basic styling to the editor. I know this probably isn&#8217;t the best way and I&#8217;m sure someone will correct me, but I just added the style to the end of the TinyMCE stylesheet which can be found here in /wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css</p>
<p><em>Photo credit: <a href="http://www.flickr.com/photos/adactio/2772835176/">adactio</a></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.paulbain.com/articles/inserting-default-content-into-wordpress-visual-editor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Finding Your Way with an iPhone and PHP</title>
		<link>http://www.paulbain.com/articles/finding-your-way-with-an-iphone-and-php/</link>
		<comments>http://www.paulbain.com/articles/finding-your-way-with-an-iphone-and-php/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 12:20:32 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[PHP Development]]></category>
		<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[BeerMap]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://www.paulbain.com/?p=97</guid>
		<description><![CDATA[The iPhone has undoubtedly revolutionised mobile phone technology, providing users access to vast amounts information wherever they are and more importantly information about where they are.
One of the projects I have been working is BeerMap, a location aware iPhone application which shows you nearby pubs, how people have rated beer and lets your add to [...]]]></description>
			<content:encoded><![CDATA[<p>The iPhone has undoubtedly revolutionised mobile phone technology, providing users access to vast amounts information wherever they are and more importantly information about where they are.</p>
<p>One of the projects I have been working is <a href="http://www.ibeermap.co.uk">BeerMap</a>, a location aware iPhone application which shows you nearby pubs, how people have rated beer and lets your add to the database by uploading reviews and images.</p>
<p>My role in this project was to produce the web service to manage all of the information, and I thought it may be useful to give a summary of the technologies used.</p>
<p><img class="aligncenter size-full wp-image-104" title="3430164569_9b64d6018b_b" src="http://www.paulbain.com/wp-content/uploads/2009/10/3430164569_9b64d6018b_b1.jpg" alt="3430164569_9b64d6018b_b" width="620" height="296" /></p>
<h3>PHP &amp; The Zend Framework</h3>
<p>The <a href="http://framework.zend.com/">Zend Framework</a> is an extensive PHP library providing the MVC approach to code structure which is also recommended for iPhone development.</p>
<p>I also heavily extended the Zend_Controller_Action class to incorporate authentication and context switching depending on the response type needed.</p>
<h3>MySQL Stored Procedures</h3>
<p>All our data is stored in a MySQL database, so it was logical to also create a mechanism within the database to calculate distances depending on longitude and latitude. This calculation can be relatively expensive so I am looking a ways to further optimise this process, however it appears to be working relatively efficiently at the moment.</p>
<h3>Plists</h3>
<p>Web services generally will provide a response in XML or JSON, however using these response formats would require additional libraries to be included within the iPhone app, increasing its size and complexity. However, by generating a <a href="http://en.wikipedia.org/wiki/Property_list">Plist</a> response, the iPhone can read this without any complex parsing or processing.</p>
<p>For this we modified a version of the <a href="http://code.google.com/p/cfpropertylist/" target="_blank">CFPropertyList</a> library and added a better mechanism for guessing variable types which I hope will be integrated into the original library at some point soon.</p>
<h3>Further Information</h3>
<p>Above is just a very brief summary of the technologies used, however please contact me for more information and take a look at the websites below:</p>
<ul>
<li><a href="http://iphone.galloway.me.uk/blog/">Matt&#8217;s Blog</a> &#8211; more information about iPhone development</li>
<li><a href="http://www.ibeermap.co.uk/">BeerMap</a> &#8211; the product site</li>
<li><a href="http://framework.zend.com/">Zend Framework</a> &#8211; a good place to start with the Zend Framework
</ul>
<p><em>Photo Credit: <a href="http://www.flickr.com/photos/scissorhands33/3430164569/">Will Ockenden</a></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.paulbain.com/articles/finding-your-way-with-an-iphone-and-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
