<?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>BIOSTALL</title>
	<atom:link href="http://biostall.com/feed" rel="self" type="application/rss+xml" />
	<link>http://biostall.com</link>
	<description>Web Development Snippets, Hints and Tips</description>
	<lastBuildDate>Wed, 22 Feb 2012 21:39:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Replacing Line Breaks With &lt;br /&gt; Tags Using JavaScript</title>
		<link>http://biostall.com/replace-line-breaks-with-br-tags-using-javascript</link>
		<comments>http://biostall.com/replace-line-breaks-with-br-tags-using-javascript#comments</comments>
		<pubDate>Wed, 22 Feb 2012 21:39:16 +0000</pubDate>
		<dc:creator>Steve Marks</dc:creator>
				<category><![CDATA[Javascript / jQuery]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[replace]]></category>

		<guid isPermaLink="false">http://biostall.com/?p=692</guid>
		<description><![CDATA[A scenario arose today where I needed to take the content within a textarea and then output it the screen as HTML. In doing this I knew I would have to take the line breaks in the textarea content (\n) and swap them out for &#60;br /&#62; HTML tags. Languages like PHP come with inbuilt [...]]]></description>
			<content:encoded><![CDATA[<p>A scenario arose today where I needed to take the content within a textarea and then output it the screen as HTML. In doing this I knew I would have to take the line breaks in the textarea content (\n) and swap them out for &lt;br /&gt; HTML tags. Languages like PHP come with <a href="http://php.net/manual/en/function.nl2br.php" title="nl2br() Function">inbuilt functions</a> to handle this kind of replacement. JavaScript however does not.</p>
<p>I started out by trying the following:</p>
<pre name="code" class="javascript">var output = document.form1.myTextarea.value.replace("\n", "&lt;br /&gt;");</pre>
<p>This kind of worked but only replaced the first line break. I then remembered from <a href="http://biostall.com/removing-all-spaces-from-a-string-using-javascript">previous</a> <a href="http://biostall.com/javascripts-replace-function-only-replacing-first-occurrence">posts</a> that the JavaScript replace() function will only swap out the first occurrence of a string.</p>
<p>A quick change was required to the code as follows:</p>
<pre name="code" class="javascript">var output = document.form1.myTextarea.value.replace(/\n/g, "&lt;br /&gt;");</pre>
<p>By turning the first parameter into a regular expression and enabling &#8216;global&#8217; matching (\g), all line breaks were now being converted as expected.</p>
]]></content:encoded>
			<wfw:commentRss>http://biostall.com/replace-line-breaks-with-br-tags-using-javascript/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Function to Connect via FTP with Retry Capability</title>
		<link>http://biostall.com/php-function-to-connect-via-ftp-with-retry-capability</link>
		<comments>http://biostall.com/php-function-to-connect-via-ftp-with-retry-capability#comments</comments>
		<pubDate>Tue, 21 Feb 2012 22:23:37 +0000</pubDate>
		<dc:creator>Steve Marks</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[function]]></category>

		<guid isPermaLink="false">http://biostall.com/?p=687</guid>
		<description><![CDATA[Let&#8217;s face it&#8230; If something can go wrong, it will go wrong. This is no exception for FTP connections either. Maybe the remote server is not accessible, the network is down, or the connection times out. PHP comes with a set of useful functions to deal with common FTP operations. What I want to show [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s face it&#8230; If something can go wrong, it will go wrong. This is no exception for FTP connections either. Maybe the remote server is not accessible, the network is down, or the connection times out.</p>
<p>PHP comes with a <a href="http://php.net/manual/en/ref.ftp.php" title="PHP FTP Functions">set of useful functions</a> to deal with common FTP operations. What I want to show you in this post however is, in conjuntion with these functions, how to improve the connection aspect and add a failsafe should a connection not be available. I find this especially effective for scripts left running as a background process.</p>
<p>Let&#8217;s take a look at the function:</p>
<pre name="code" class="php">function connect_to_ftp($ftp_host, $ftp_user, $ftp_pass, $retries)
{
	$connected = false;
	$retry = 0;

	// Keep looping until connected or met no. of retries if $retries is not zero
	while (!$connected &#038;&#038; ($retries==0 || ($retries&gt;0 &#038;&#038; $retry&lt;$retries)))
	{
		// try connecting to host
		$ftp_conn = ftp_connect($ftp_host);

		if ($ftp_conn)
		{
			// connection was successful. now try to login
			$ftp_login = ftp_login($ftp_conn, $ftp_user, $ftp_pass);

			if ($ftp_login)
			{
				// login was successful. let's get outta here...
				return $ftp_conn;
			}
			else
			{
				echo "Unable to login to ".$ftp_host." using ".$ftp_user.":".$ftp_pass."\n";
			}
		}
		else
		{
			echo "Unable to establish FTP connection to ".$ftp_host."\n";
		}

		sleep(5); // sleep for 5 seconds before trying again

		$retry++;
	}

	return $ftp_conn;
}</pre>
<p>And an example of using the function:</p>
<pre name="code" class="php">// initialise FTP connection details
$ftp_host = 'ftp.mysite.com';
$ftp_user = 'username';
$ftp_pass = 'password';
$retries = 0; // Number of maximum retries. Set to 0 for unlimited

// returned is an FTP connection as a resource for use in other functions
$ftp_conn = connect_to_ftp($ftp_host, $ftp_user, $ftp_pass, $retries);

echo 'FTP Connection: '.$ftp_conn;</pre>
]]></content:encoded>
			<wfw:commentRss>http://biostall.com/php-function-to-connect-via-ftp-with-retry-capability/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bring Google Map Markers to Front on Hover</title>
		<link>http://biostall.com/bring-google-map-marker-to-front-on-hover</link>
		<comments>http://biostall.com/bring-google-map-marker-to-front-on-hover#comments</comments>
		<pubDate>Tue, 21 Feb 2012 20:46:22 +0000</pubDate>
		<dc:creator>Steve Marks</dc:creator>
				<category><![CDATA[Javascript / jQuery]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[google maps]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://biostall.com/?p=666</guid>
		<description><![CDATA[When placing markers onto a map using the Google Maps V3 API they will be placed from front-to-back based on their lat/lng. This is normally fine but can cause a problem when there are lots of overlapping markers congregated together, or when the user is viewing the map at a lower zoom level, at which [...]]]></description>
			<content:encoded><![CDATA[<p>When placing markers onto a map using the Google Maps V3 API they will be placed from front-to-back based on their lat/lng. This is normally fine but can cause a problem when there are lots of overlapping markers congregated together, or when the user is viewing the map at a lower zoom level, at which point it can be tricky to select certain markers that have been pushed back.</p>
<p>As a result of the above I needed a way to bring markers to the front when the user hovered their mouse over them. I&#8217;ve included the code below but first let&#8217;s start with a demonstration of the problem faced and how the code helps:<br />
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script><br />
<script type="text/javascript">
		var map;
		// array of markers added to the map
		// used at a later date
		var markers = new Array();
		// a global variable used to store the highest zIndex
		// saves calculating it repeatedly 
		var highestZIndex = 0;
		function initialize() {
			/* SETUP MAP */
			var myLatlng = new google.maps.LatLng(52.06768, -1.33758);
			var mapOptions = {
				center: myLatlng,
				zoom: 10,
				mapTypeId: google.maps.MapTypeId.ROADMAP
			}
			map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
			/* ADD 1st MARKER */
			var markerOptions = {
				position: new google.maps.LatLng(52.06768, -1.32058), 
				map: map,
				zIndex:1
			};
			var marker = new google.maps.Marker(markerOptions);
			markers.push(marker);
			marker.set("myZIndex", marker.getZIndex());
			// add mouseover and mouseout events to first marker
			google.maps.event.addListener(marker, "mouseover", function() {
				getHighestZIndex();
				this.setOptions({zIndex:highestZIndex});
			});
			google.maps.event.addListener(marker, "mouseout", function() {
				this.setOptions({zIndex:this.get("myZIndex")});
			});
			/* ADD 2nd MARKER */
			var markerOptions = {
				position: new google.maps.LatLng(52.06768, -1.33758), 
				map: map,
				zIndex:2	
			};
			var marker = new google.maps.Marker(markerOptions);
			markers.push(marker);
			marker.set("myZIndex", marker.getZIndex());
			// add mouseover and mouseout events to second marker
			google.maps.event.addListener(marker, "mouseover", function() {
				getHighestZIndex();
				this.setOptions({zIndex:highestZIndex+1});
			});
			google.maps.event.addListener(marker, "mouseout", function() {
				this.setOptions({zIndex:this.get("myZIndex")});
			});
		}
		function getHighestZIndex() {
			// if we haven't previously got the highest zIndex
			// save it as no need to do it multiple times
			if (highestZIndex==0) {
				if (markers.length>0) {
					// loop through markers
					for (var i=0; i<markers.length; i++) {
						tempZIndex = markers[i].getZIndex();
						// if this zIndex is the highest so far
						if (tempZIndex>highestZIndex) {
							highestZIndex = tempZIndex;
						}
					}
				}
			}
			return highestZIndex;
		}
window.onload = initialize;
	</script></p>
<div id="map_canvas" style="width:100%; height:250px; border:1px solid #666"></div>
<p>Try rolling over the markers and you&#8217;ll see that the one to the rear will come to the front. This isn&#8217;t just limited to two markers either. It will work regardless of the number of markers shown on the map.</p>
<p>Ok, so onto the code:</p>
<pre name="code" class="javascript">var map;
// array of markers added to the map
// used at a later date
var markers = new Array();
// a global variable used to store the highest zIndex
// saves calculating it repeatedly
var highestZIndex = 0;

function initialize() {

	/* SETUP MAP */
	var myLatlng = new google.maps.LatLng(52.06768, -1.33758);
	var mapOptions = {
		center: myLatlng,
		zoom: 10,
		mapTypeId: google.maps.MapTypeId.ROADMAP
	}
	map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);

	/* ADD 1st MARKER */
	var markerOptions = {
		position: new google.maps.LatLng(52.06768, -1.32058),
		map: map,
		zIndex:1 // important!
	};
	var marker = new google.maps.Marker(markerOptions);
	markers.push(marker);
	// assign a custom variable to this marker containing the zIndex
	marker.set("myZIndex", marker.getZIndex());

	// add mouseover and mouseout events to first marker
	google.maps.event.addListener(marker, "mouseover", function() {
		getHighestZIndex();
		this.setOptions({zIndex:highestZIndex});
	});
	google.maps.event.addListener(marker, "mouseout", function() {
		this.setOptions({zIndex:this.get("myZIndex")});
	});

	/* ADD 2nd MARKER */
	var markerOptions = {
		position: new google.maps.LatLng(52.06768, -1.33758),
		map: map,
		zIndex:2 // important!
	};
	var marker = new google.maps.Marker(markerOptions);
	markers.push(marker);
	// assign a custom variable to this marker containing the zIndex
	marker.set("myZIndex", marker.getZIndex());

	// add mouseover and mouseout events to second marker
	google.maps.event.addListener(marker, "mouseover", function() {
		getHighestZIndex();
		this.setOptions({zIndex:highestZIndex+1});
	});
	google.maps.event.addListener(marker, "mouseout", function() {
		this.setOptions({zIndex:this.get("myZIndex")});
	});

}

function getHighestZIndex() {

	// if we haven't previously got the highest zIndex
	// save it as no need to do it multiple times
	if (highestZIndex==0) {
		if (markers.length>0) {
			// loop through markers
			for (var i=0; i&lt;markers.length; i++) {
				tempZIndex = markers[i].getZIndex();
				// if this zIndex is the highest so far
				if (tempZIndex>highestZIndex) {
					highestZIndex = tempZIndex;
				}
			}
		}
	}
	return highestZIndex;

}</pre>
<p>One important thing to note regarding the above is that markers must have a zIndex option set, either by specifying it when adding the marker initially or by using the setOption() function. Without a zIndex, the function getZindex() will return &#8216;undefined&#8217;.</p>
]]></content:encoded>
			<wfw:commentRss>http://biostall.com/bring-google-map-marker-to-front-on-hover/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IIS Able To Connect Via FTP But Can&#8217;t Upload Files</title>
		<link>http://biostall.com/iis-able-to-connect-via-ftp-but-cant-upload-files</link>
		<comments>http://biostall.com/iis-able-to-connect-via-ftp-but-cant-upload-files#comments</comments>
		<pubDate>Mon, 20 Feb 2012 21:16:18 +0000</pubDate>
		<dc:creator>Steve Marks</dc:creator>
				<category><![CDATA[Server Management]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[iis]]></category>

		<guid isPermaLink="false">http://biostall.com/?p=669</guid>
		<description><![CDATA[Over the past couple of days I&#8217;ve been setting up a new box running Windows Server 2008 r2. One of the main requirements for it was that it should be able to accept file uploads via FTP. This wasn&#8217;t too much of a problem and seemed to be relatively easy&#8230; Install the IIS role, install [...]]]></description>
			<content:encoded><![CDATA[<p>Over the past couple of days I&#8217;ve been setting up a new box running Windows Server 2008 r2. One of the main requirements for it was that it should be able to accept file uploads via FTP. This wasn&#8217;t too much of a problem and seemed to be relatively easy&#8230; Install the IIS role, install the FTP service and setup an FTP site along with any associated users.</p>
<p>All was going well and I was able to connect to the server remotely as a standard user with no problem at all. When I came to upload a file however I started to get the following error:</p>
<p><code>550 Access is denied</code></p>
<p><strong>The Solution</strong></p>
<p>After a bit of investigation I managed to solve the problem by following the steps below:</p>
<p>1. Open the &#8216;Internet Information Services (IIS) Manager&#8217;. You should be able to find this in your Start menu under &#8216;Administrative Tools&#8217;.</p>
<p>2. Once opened, right-click your FTP site and select &#8216;Edit Permissions&#8230;&#8217; from the menu:</p>
<p><img src="http://biostall.com/wp-content/uploads/2012/02/iis-ftp-upload-1.jpg" alt="IIS FTP Upload Access Denied 1" title="iis-ftp-upload-1" width="520" height="544" class="alignnone size-full wp-image-670" /></p>
<p>3. Select the &#8216;Security&#8217; tab.</p>
<p>4. Click the &#8216;Users&#8217; group. You can see from the permissions shown underneath that by default this group doesn&#8217;t have &#8216;Write&#8217; permissions:</p>
<p><img src="http://biostall.com/wp-content/uploads/2012/02/iis-ftp-upload-2.jpg" alt="IIS FTP Upload Access Denied 2" title="iis-ftp-upload-2" width="367" height="474" class="alignnone size-full wp-image-671" /></p>
<p>5. Click &#8216;Edit&#8230;&#8217; and select to allow the &#8216;Write&#8217; permission:</p>
<p><img src="http://biostall.com/wp-content/uploads/2012/02/iis-ftp-upload-3.jpg" alt="IIS FTP Upload Access Denied 3" title="iis-ftp-upload-3" width="367" height="443" class="alignnone size-full wp-image-672" /></p>
<p>6. Click &#8216;OK&#8217; to save the changes.</p>
<p>Once the above change has been performed you should now be able to successfully upload files without problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://biostall.com/iis-able-to-connect-via-ftp-but-cant-upload-files/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EPC (Energy Performance Certificates) Graph Individual Parts</title>
		<link>http://biostall.com/epc-energy-performance-certificates-graph-individual-parts</link>
		<comments>http://biostall.com/epc-energy-performance-certificates-graph-individual-parts#comments</comments>
		<pubDate>Fri, 17 Feb 2012 19:28:37 +0000</pubDate>
		<dc:creator>Steve Marks</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://biostall.com/?p=659</guid>
		<description><![CDATA[You&#8217;ll probably be familiar with EPC (Energy Performance Certificates) graphs if you work in the property or energy industry. In essence they provide valuable information as to the current and potential energy efficiency of a home. In the UK all properties bought, sold or rented require an EPC. Whilst recently playing with EPC graphs from [...]]]></description>
			<content:encoded><![CDATA[<p>You&#8217;ll probably be familiar with EPC (Energy Performance Certificates) graphs if you work in the property or energy industry. In essence they provide valuable information as to the current and potential energy efficiency of a home. In the UK all properties bought, sold or rented require an EPC.</p>
<p>Whilst recently playing with EPC graphs from a programmatic point of view I couldn&#8217;t find an EPC graph split into all it&#8217;s individual parts. As a result I created my own set of images and include it for download from the link below:</p>
<p><a href='http://biostall.com/wp-content/uploads/2012/02/epc-graph-parts.zip'><strong>Download Here</strong></a></p>
<p>Here&#8217;s a preview of whats included:</p>
<p><a href="http://biostall.com/wp-content/uploads/2012/02/epc-graph-parts.zip"><img src="http://biostall.com/wp-content/uploads/2012/02/epc-graph-parts.gif" alt="EPC Graph Parts" title="epc-graph-parts" width="578" height="300" class="alignnone size-full wp-image-661" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://biostall.com/epc-energy-performance-certificates-graph-individual-parts/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stop WordPress Closing Code Blocks When it Encounters a Blank Line</title>
		<link>http://biostall.com/stop-wordpress-closing-code-blocks-on-blank-line</link>
		<comments>http://biostall.com/stop-wordpress-closing-code-blocks-on-blank-line#comments</comments>
		<pubDate>Thu, 09 Feb 2012 20:39:18 +0000</pubDate>
		<dc:creator>Steve Marks</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://biostall.com/?p=656</guid>
		<description><![CDATA[WordPress allows you to highlight blocks of code for readability when writing a post or typing a comment. This can easily be acheived by adding text between &#60;code&#62;&#60;/code&#62; tags at which point it will put it in a pretty little box and differentiate it from the rest of the content. If you&#8217;re reading this however [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress allows you to highlight blocks of code for readability when writing a post or typing a comment. This can easily be acheived by adding text between &lt;code&gt;&lt;/code&gt; tags at which point it will put it in a pretty little box and differentiate it from the rest of the content. If you&#8217;re reading this however you probably already knew that.</p>
<p>The problem I faced however was, if I added one or more blank lines within these &lt;code&gt;&lt;/code&gt; tags it would completely split up what was before the new line and what was after. Allow me to show you an example of what I mean:</p>
<p><code>This is a line of text with a blank line after it.</p>
<p>This is the second line of text with a blank line before it.</code></p>
<p>See how it looks like two separate code snippets?</p>
<p><strong>The Solution</strong></p>
<p>The solution turned out to relatively simple. All that was needed was to add a &amp;nbsp; (non-breaking space) character or &lt;br /&gt; tag on the blank line and it would keep the code block complete around all lines.</p>
<p>I&#8217;ve include below an example where I place a &lt;br /&gt; tag on the blank line in the middle:</p>
<p><code>This is a line of text with a blank line after it.<br />
<br />
This is the second line of text with a blank line before it.</code></p>
]]></content:encoded>
			<wfw:commentRss>http://biostall.com/stop-wordpress-closing-code-blocks-on-blank-line/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Fix IE8 Error &#8220;Unable to download X.php from yoursite.com&#8221;</title>
		<link>http://biostall.com/how-to-fix-ie8-error-unable-to-download-x-php-from-yoursite-com</link>
		<comments>http://biostall.com/how-to-fix-ie8-error-unable-to-download-x-php-from-yoursite-com#comments</comments>
		<pubDate>Thu, 09 Feb 2012 20:18:46 +0000</pubDate>
		<dc:creator>Steve Marks</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[internet explorer]]></category>

		<guid isPermaLink="false">http://biostall.com/?p=651</guid>
		<description><![CDATA[Rarely do I hear the words &#8220;Internet Explorer&#8221; and &#8220;Error&#8221; mentioned in the same sentence. Alright&#8230; maybe that&#8217;s a bit of a lie. Unfortunately however, few us can control what browsers our users are using so we have to try and cater for all instances. The one I&#8217;m going to talk about today is specific [...]]]></description>
			<content:encoded><![CDATA[<p>Rarely do I hear the words &#8220;Internet Explorer&#8221; and &#8220;Error&#8221; mentioned in the same sentence. Alright&#8230; maybe that&#8217;s a bit of a lie. Unfortunately however, few us can control what browsers our users are using so we have to try and cater for all instances. The one I&#8217;m going to talk about today is specific to IE8 and occured when trying to force the download of a PDF to the browser in a PHP script.</p>
<p>The error reads as follows:</p>
<pre name="code" class="html">Unable to download somefile.php from yoursite.com.

Internet Explorer was unable to open this site. The requested site is
either unavailable or cannot be found. Please try again later.</pre>
<p>After looking into the problem it turned out that the problem was down to the PHP headers being sent when outputting the file, inparticular the &#8216;Cache-Control&#8217; header. If this header is not being set, or is not being set correctly you can start to experience problems.</p>
<p><strong>The Solution</strong></p>
<p>Previously I wasn&#8217;t using the aforementioned &#8216;Cache-Control&#8217; header but apparently setting it to &#8216;no-cache&#8217; or &#8216;no-store&#8217; will have the same negative effect. For me the answer was to set it to &#8216;private&#8217; or to set it with a blank value. Like so:</p>
<pre name="code" class="html">header("Cache-Control: private");</pre>
<p>Or:</p>
<pre name="code" class="html">header("Cache-Control: ");</pre>
<p>The site in question was also being used over SSL but I&#8217;m not sure if this also played a role. Regardless, the above worked and it kept our IE8 users happy.</p>
]]></content:encoded>
			<wfw:commentRss>http://biostall.com/how-to-fix-ie8-error-unable-to-download-x-php-from-yoursite-com/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Resolve &#8220;X is not a verified user&#8221; When Adding Developer to Facebook App Roles</title>
		<link>http://biostall.com/is-not-a-verified-user-facebook-app-developer-roles</link>
		<comments>http://biostall.com/is-not-a-verified-user-facebook-app-developer-roles#comments</comments>
		<pubDate>Wed, 08 Feb 2012 20:39:13 +0000</pubDate>
		<dc:creator>Steve Marks</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[error]]></category>

		<guid isPermaLink="false">http://biostall.com/?p=647</guid>
		<description><![CDATA[Whilst recently building my first Facebook app, one of the things I wanted to do was share ownership with another developer so we could both work on it and share other apps in the future. When trying to add this other user I kept getting an error returned claiming that they were not a verified [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://biostall.com/wp-content/uploads/2012/02/is-not-a-verified-user-facebook-app-developer-roles.jpg" alt="Is not a verified user" title="is-not-a-verified-user-facebook-app-developer-roles" width="578" height="93" class="alignnone size-full wp-image-648 postheader" /></p>
<p>Whilst recently building my first Facebook app, one of the things I wanted to do was share ownership with another developer so we could both work on it and share other apps in the future. When trying to add this other user I kept getting an error returned claiming that they were not a verified user.</p>
<p>When looking into how to resolve this I saw a number of possible causes mentioned across the web, from the app being in &#8216;Sandbox&#8217; mode, to groups not being setup correctly.</p>
<p>None of these proposed solutions worked and after digging a little further I found this page on Facebook help:</p>
<p><a href="http://www.facebook.com/help/?faq=167551763306531" title="How do I verify my developer account?">How do I verify my developer account?</a></p>
<p>It turns out that to be added to a role for a Facebook app you need to verify your account via phone or by adding a credit card. After trying the steps explained on the page above I was then able to add the second developer successfully.</p>
]]></content:encoded>
			<wfw:commentRss>http://biostall.com/is-not-a-verified-user-facebook-app-developer-roles/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL DELETE Query Statement With JOIN</title>
		<link>http://biostall.com/mysql-delete-query-statement-with-join</link>
		<comments>http://biostall.com/mysql-delete-query-statement-with-join#comments</comments>
		<pubDate>Sat, 03 Dec 2011 15:16:17 +0000</pubDate>
		<dc:creator>Steve Marks</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://biostall.com/?p=640</guid>
		<description><![CDATA[Executing a MySQL DELETE query that contains a JOIN&#8230; This is something that I always forget how to do so I wanted to write about it as a personal reference, and to help others looking to do the same. First lets take a look at a standard DELETE query containing a single table: DELETE FROM [...]]]></description>
			<content:encoded><![CDATA[<p>Executing a MySQL DELETE query that contains a JOIN&#8230; This is something that I always forget how to do so I wanted to write about it as a personal reference, and to help others looking to do the same. First lets take a look at a standard DELETE query containing a single table:</p>
<pre name="code" class="html">DELETE FROM
	`my_table`
WHERE
	`my_value`='FooBar';</pre>
<p>Easy right? Now, the next part is where I was going wrong and I&#8217;m guessing is the same in your case. The next statement shows how you might first try to perform the DELETE with a JOIN based on other MySQL syntax:</p>
<pre name="code" class="html">DELETE FROM
	`my_table`
INNER JOIN `second_table` ON `second_table`.`id_column`=`my_table`.`id_column`
WHERE
	`my_value`='FooBar';</pre>
<p>By running the above you&#8217;ll get the following error:</p>
<pre name="code" class="html">#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INNER JOIN `second_table` ON `second_table`.`id_column`=`my_table`.`id_column` WHERE `my_va' ne 1</pre>
<p><strong>The Solution</strong></p>
<p>Sticking with the query above we can get it to work with a simple amendment. All we need to do is put the name of the table we&#8217;re deleting from between the words &#8216;DELETE&#8217; and &#8216;FROM&#8217; like so:</p>
<pre name="code" class="html">DELETE `my_table` FROM
	`my_table`
INNER JOIN `second_table` ON `second_table`.`id_column`=`my_table`.`id_column`
WHERE
	`my_value`='FooBar';</pre>
]]></content:encoded>
			<wfw:commentRss>http://biostall.com/mysql-delete-query-statement-with-join/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Resolve SugarCRM &#8220;You have been logged out because your session has expired&#8221;</title>
		<link>http://biostall.com/resolve-sugarcrm-you-have-been-logged-out-because-your-session-has-expired</link>
		<comments>http://biostall.com/resolve-sugarcrm-you-have-been-logged-out-because-your-session-has-expired#comments</comments>
		<pubDate>Mon, 24 Oct 2011 21:23:57 +0000</pubDate>
		<dc:creator>Steve Marks</dc:creator>
				<category><![CDATA[Server Management]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://biostall.com/?p=635</guid>
		<description><![CDATA[Upon trying to login to SugarCRM ealier today I kept getting an error stating &#8220;You have been logged out because your session has expired&#8221;. I knew the details were correct but no matter how many times I tried the same message kept coming up and I could not login. Upon fumbling around for a while [...]]]></description>
			<content:encoded><![CDATA[<p>Upon trying to login to SugarCRM ealier today I kept getting an error stating &#8220;You have been logged out because your session has expired&#8221;. I knew the details were correct but no matter how many times I tried the same message kept coming up and I could not login. Upon fumbling around for a while I came across a couple of solutions, one of which resolved the problem. I explain these in more detail below:</p>
<p><strong>Solution One &#8211; Session Directory Not Writable</strong></p>
<p>This first solution wasn&#8217;t relevant in my case but I did see it mentioned a few times on my travels as a very likely resolution to the problem mentioned above and thought it worth a mention it here.</p>
<p>When you&#8217;re logged into SugarCRM it uses PHP sessions to store information about your current visit. This solution suggests that the directory where this session information is stored is not writable and therefore SugarCRM is unable to continue past the login screen.</p>
<p>So where is this directory? The first place to look is in your SugarCRM configuration file. This can found in the root of your SugarCRM installation and is in a file called config.php. Within this PHP file is a reference to where sessions will be stored. If this contains a valid path then ensure SugarCRM has <a href="http://www.tuxfiles.org/linuxhelp/filepermissions.html">permission to write to it</a>.</p>
<p>If the above path in config.php is blank then SugarCRM will use the path set in the php.ini file. You can view what this is set to by creating a PHP file and entering the following:</p>
<pre name="code" class="php">echo ini_get("session.save_path");</pre>
<p><strong>Solution Two &#8211; Disk Out Of Space</strong></p>
<p>The other possible cause of the error was that the disk where SugarCRM is located was out of space which was the case in my scenario. By simply deleting a few old backups and cleaning down unused files I was then able to login again immediately.</p>
]]></content:encoded>
			<wfw:commentRss>http://biostall.com/resolve-sugarcrm-you-have-been-logged-out-because-your-session-has-expired/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  biostall.com/feed ) in 0.65230 seconds, on Feb 23rd, 2012 at 1:26 am UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 23rd, 2012 at 2:26 am UTC -->
