
<rss version="2.0">
<channel>
	<title>Think Blue - blogs@bluerhinos.co.uk</title>
	<link>http://blogs.bluerhinos.co.uk/thinkblue</link>
	<description>The thinkings from the coders at bluerhinos.co.uk on blogs@bluerhinos.co.uk</description>
	<managingEditor>Error(Error)</managingEditor>
	<webMaster>Error(Error)</webMaster>
	<lastBuildDate>Sat, 19 May 2012 11:10:00 +0100</lastBuildDate>
	<generator>chemBlog</generator>

	<item>
	<title>My First GitHub Project: phpMQTT</title>
	<author>andrew@bluerhinos.co.uk  (Andrew Milsted)</author>
	<guid isPermaLink="true">http://blogs.bluerhinos.co.uk/thinkblue/56/My_First_GitHub_Project_phpMQTT.html</guid>
	<link>http://blogs.bluerhinos.co.uk/thinkblue/56/My_First_GitHub_Project_phpMQTT.html</link>
	<pubDate>Thu, 09 Sep 2010 22:33:10 +0100</pubDate>
	<description>So I may be a bit late to the party, but I have now created by first GitHub project. For my project I decided to actually finish my MQTT class.&lt;br style=&quot;clear:left;&quot;/&gt;&lt;br style=&quot;clear:left;&quot;/&gt;I have posted it at &lt;a href=&quot;http://github.com/bluerhinos/phpMQTT&quot;&gt;http://github.com/bluerhinos/phpMQTT&lt;/a&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;br style=&quot;clear:left;&quot;/&gt;At the moment the publishing part works a treat, but there currently a problem with the subscribe part (hangs after about 3 hours) I am trying to trace the fault. Also at the moment it will only support quality of service (qos) of 0. &lt;br style=&quot;clear:left;&quot;/&gt; &lt;br style=&quot;clear:left;&quot;/&gt;Example Publishing:&lt;br style=&quot;clear:left;&quot;/&gt;&lt;pre class=&quot;php&quot; style=&quot;color: #000066; border: 1px solid #d0d0d0; background-color: #f0f0f0; padding:5px;&quot;&gt;&lt;div style=&quot;font-family: Verdana, Arial, sans-serif; color: #808080; font-size: 70%; font-weight: bold; border-bottom: 1px solid #d0d0d0; padding: 0px;&quot;&gt;php code:&lt;/div&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;require&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;../phpMQTT.php&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$mqtt&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; phpMQTT&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;/* broker(broker address, broker port, client id); */&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$mqtt&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;broker&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;example.com&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;1883&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;PHP MQTT Client&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$mqtt&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;connect&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;/* publish( topic, message, qos); */&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$mqtt&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;publish&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;bluerhinos/phpMQTT/examples/publishtest&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;Hello World!&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$mqtt&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;close&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;</description>
</item>


	<item>
	<title>Keeping the GeoIP databases up to date</title>
	<author>andrew@bluerhinos.co.uk  (Andrew Milsted)</author>
	<guid isPermaLink="true">http://blogs.bluerhinos.co.uk/thinkblue/48/Keeping_the_GeoIP_databases_up_to_date.html</guid>
	<link>http://blogs.bluerhinos.co.uk/thinkblue/48/Keeping_the_GeoIP_databases_up_to_date.html</link>
	<pubDate>Fri, 26 Mar 2010 21:47:26 +0000</pubDate>
	<description>I needed to keep my GeoIP db up to date for my stats package so I decided to write a cron script that would do it for me.&lt;br style=&quot;clear:left;&quot;/&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;pre class=&quot;bash&quot; style=&quot;color: #000066; border: 1px solid #d0d0d0; background-color: #f0f0f0; padding:5px;&quot;&gt;&lt;div style=&quot;font-family: Verdana, Arial, sans-serif; color: #808080; font-size: 70%; font-weight: bold; border-bottom: 1px solid #d0d0d0; padding: 0px;&quot;&gt;bash code:&lt;/div&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;#!/bin/bash&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;nbsp;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;#############################################################&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;# ./geoipupdate = Auto updates the free GeoIP databases&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;# (c) andrew[at]bluerhinos.co.uk 2010 : Creative Commons&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;#############################################################&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;nbsp;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;#list of urls&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #007800;&quot;&gt;URLS=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; &lt;a href=&quot;http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz&amp;quot;&quot;&gt;http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz&amp;quot;&lt;/a&gt;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #007800;&quot;&gt;URLS=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;$URLS &lt;a href=&quot;http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz&amp;quot;&quot;&gt;http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz&amp;quot;&lt;/a&gt;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;nbsp;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;#target directory&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #007800;&quot;&gt;TARGETDIR=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;/var/lib/GeoIP&amp;quot;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;nbsp;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;for&lt;/span&gt; URL &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;in&lt;/span&gt; &lt;span style=&quot;color: #007800;&quot;&gt;$URLS&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;do&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;        &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;wget&lt;/span&gt; -q -N -P &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;$TARGETDIR&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;$URL&amp;quot;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;        &lt;span style=&quot;color: #007800;&quot;&gt;BASENAME=&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;`&lt;/span&gt;&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;basename&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;$URL&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;`&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;        &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;gunzip&lt;/span&gt; -f  &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;$TARGETDIR/$BASENAME&amp;quot;&lt;/span&gt;;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;done&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;nbsp;&lt;/pre&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;br style=&quot;clear:left;&quot;/&gt;Place the above code (or download here &lt;a href=&quot;http://blogs.bluerhinos.co.uk/data/files/9/geoipupdate&quot;&gt;http://blogs.bluerhinos.co.uk/data/files/9/geoipupdate&lt;/a&gt; ) into /etc/cron.monthly/geoipupdate&lt;br style=&quot;clear:left;&quot;/&gt;&lt;br style=&quot;clear:left;&quot;/&gt;Note: they update their db on the 1st or 2nd so I changed my /etc/crontab so that the monthly scrips run on the 3rd</description>
</item>


	<item>
	<title>A simple way to make pretty urls </title>
	<author>andrew@bluerhinos.co.uk  (Andrew Milsted)</author>
	<guid isPermaLink="true">http://blogs.bluerhinos.co.uk/thinkblue/44/A_simple_way_to_make_pretty_urls_.html</guid>
	<link>http://blogs.bluerhinos.co.uk/thinkblue/44/A_simple_way_to_make_pretty_urls_.html</link>
	<pubDate>Mon, 25 Jan 2010 23:06:46 +0000</pubDate>
	<description>If you are like me, you dislike the .php extension for web pages that display content, eg /contactus.php . To me this is a web page that is displaying HTML, so lets give it an .html suffix. but the easist way to implements templates is to use html.&lt;br style=&quot;clear:left;&quot;/&gt;&lt;br style=&quot;clear:left;&quot;/&gt;To achieve this easily just create a .htaccess file to redirect .html's to .php.&lt;br style=&quot;clear:left;&quot;/&gt;&lt;pre style=&quot;color: #000066; border: 1px solid #d0d0d0; background-color: #f0f0f0; padding:5px;&quot;&gt;&lt;div style=&quot;font-family: Verdana, Arial, sans-serif; color: #808080; font-size: 70%; font-weight: bold; border-bottom: 1px solid #d0d0d0; padding: 0px;&quot;&gt;.htaccess code:&lt;/div&gt;&amp;nbsp;&lt;br style=&quot;clear:left;&quot;/&gt;RewriteEngine On&lt;br style=&quot;clear:left;&quot;/&gt;RewriteRule (.*).html $1.php [QSA]&lt;br style=&quot;clear:left;&quot;/&gt;&amp;nbsp;&lt;/pre&gt;(The QSA just forwards all variables to the .php script)&lt;br style=&quot;clear:left;&quot;/&gt;&lt;b&gt;Requirements:&lt;/b&gt; are apache and mod_rewrite&lt;br style=&quot;clear:left;&quot;/&gt;&lt;b&gt;More Info:&lt;/b&gt; &lt;a href=&quot;http://www.kuro5hin.org/story/2003/7/31/2335/08552&quot;&gt;http://www.kuro5hin.org/story/2003/7/31/2335/08552&lt;/a&gt;</description>
</item>


	<item>
	<title>PHP Function to return Beaufort Scale</title>
	<author>andrew@bluerhinos.co.uk  (Andrew Milsted)</author>
	<guid isPermaLink="true">http://blogs.bluerhinos.co.uk/thinkblue/41/PHP_Function_to_return_Beaufort_Scale.html</guid>
	<link>http://blogs.bluerhinos.co.uk/thinkblue/41/PHP_Function_to_return_Beaufort_Scale.html</link>
	<pubDate>Sat, 28 Nov 2009 23:23:08 +0000</pubDate>
	<description>I was working on a project that needed to list the Beaufort wind force. The first attempt was to do a lookup based function using the data here: &lt;a href=&quot;http://en.wikipedia.org/wiki/Beaufort_scale&quot;&gt;http://en.wikipedia.org/wiki/Beaufort_scale&lt;/a&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;b&gt;Attempt 1&lt;/b&gt;&lt;pre class=&quot;php&quot; style=&quot;color: #000066; border: 1px solid #d0d0d0; background-color: #f0f0f0; padding:5px;&quot;&gt;&lt;div style=&quot;font-family: Verdana, Arial, sans-serif; color: #808080; font-size: 70%; font-weight: bold; border-bottom: 1px solid #d0d0d0; padding: 0px;&quot;&gt;php code:&lt;/div&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; beaufort_scale&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$speed&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #000033;&quot;&gt;$unit&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;m/s&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;nbsp;&lt;br style=&quot;clear:left;&quot;/&gt;    &lt;span style=&quot;color: #000033;&quot;&gt;$units&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'m/s'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;    &lt;span style=&quot;color: #000033;&quot;&gt;$units&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'kph'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;3.6&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;    &lt;span style=&quot;color: #000033;&quot;&gt;$units&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'mph'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;0.44704&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;    &lt;span style=&quot;color: #000033;&quot;&gt;$units&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'kts'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;0.514444444&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;nbsp;&lt;br style=&quot;clear:left;&quot;/&gt;    &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;!&lt;/span&gt;&lt;a href=&quot;http://www.php.net/in_array&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;in_array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$unit&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;a href=&quot;http://www.php.net/array_keys&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;array_keys&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$units&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;        &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;Error: couldn't recognise unit&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;nbsp;&lt;br style=&quot;clear:left;&quot;/&gt;    &lt;span style=&quot;color: #000033;&quot;&gt;$speed&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;*=&lt;/span&gt; &lt;span style=&quot;color: #000033;&quot;&gt;$units&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$unit&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;nbsp;&lt;br style=&quot;clear:left;&quot;/&gt;    &lt;span style=&quot;color: #000033;&quot;&gt;$scale&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0.3&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;1.5&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;3.4&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;5.4&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;7.9&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;10.7&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;13.8&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;17.1&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;20.7&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;24.4&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;28.4&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;32.6&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;1000&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;nbsp;&lt;br style=&quot;clear:left;&quot;/&gt;    &lt;span style=&quot;color: #b1b100;&quot;&gt;foreach&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$scale&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;as&lt;/span&gt; &lt;span style=&quot;color: #000033;&quot;&gt;$key&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$val&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;        &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$speed&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;=&lt;/span&gt; &lt;span style=&quot;color: #000033;&quot;&gt;$val&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000033;&quot;&gt;$key&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;    &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;'Error'&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;br style=&quot;clear:left;&quot;/&gt;I then noticed on the wikipedia page the scale's empirical formula&lt;br style=&quot;clear:left;&quot;/&gt;so i thought i could improve the function ;)&lt;br style=&quot;clear:left;&quot;/&gt;&lt;blockquote&gt;v = 0.866 * B&lt;sup&gt;3/2&lt;/sup&gt; (units m/s)&lt;/blockquote&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;b&gt;Attempt 2&lt;/b&gt;&lt;pre class=&quot;php&quot; style=&quot;color: #000066; border: 1px solid #d0d0d0; background-color: #f0f0f0; padding:5px;&quot;&gt;&lt;div style=&quot;font-family: Verdana, Arial, sans-serif; color: #808080; font-size: 70%; font-weight: bold; border-bottom: 1px solid #d0d0d0; padding: 0px;&quot;&gt;php code:&lt;/div&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; beaufort_scale&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$speed&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #000033;&quot;&gt;$unit&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;m/s&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #000033;&quot;&gt;$rnd&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;nbsp;&lt;br style=&quot;clear:left;&quot;/&gt;   &lt;span style=&quot;color: #000033;&quot;&gt;$units&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'m/s'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;   &lt;span style=&quot;color: #000033;&quot;&gt;$units&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'kph'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;3.6&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;   &lt;span style=&quot;color: #000033;&quot;&gt;$units&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'mph'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;0.44704&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;   &lt;span style=&quot;color: #000033;&quot;&gt;$units&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'kts'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;0.514444444&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;nbsp;&lt;br style=&quot;clear:left;&quot;/&gt;   &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;!&lt;/span&gt;&lt;a href=&quot;http://www.php.net/in_array&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;in_array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$unit&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;a href=&quot;http://www.php.net/array_keys&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;array_keys&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$units&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;      &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;Error: couldn't recognise unit&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;   &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;nbsp;&lt;br style=&quot;clear:left;&quot;/&gt;   &lt;span style=&quot;color: #000033;&quot;&gt;$speed&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;*=&lt;/span&gt; &lt;span style=&quot;color: #000033;&quot;&gt;$units&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$unit&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;nbsp;&lt;br style=&quot;clear:left;&quot;/&gt;   &lt;span style=&quot;color: #000033;&quot;&gt;$scale&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;a href=&quot;http://www.php.net/pow&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;pow&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$speed&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0.836&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;nbsp;&lt;br style=&quot;clear:left;&quot;/&gt;   &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;a href=&quot;http://www.php.net/round&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;round&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$scale&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$rnd&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt; This one has the added ability of returning a decimal answer</description>
</item>


	<item>
	<title>Getting php-ffmpeg and an x264 enabled ffmpeg of the same machine (debian)</title>
	<author>andrew@bluerhinos.co.uk  (Andrew Milsted)</author>
	<guid isPermaLink="true">http://blogs.bluerhinos.co.uk/thinkblue/30/Getting_phpffmpeg_and_an_x264_enabled_ffmpeg_of_the_same_machine_debian.html</guid>
	<link>http://blogs.bluerhinos.co.uk/thinkblue/30/Getting_phpffmpeg_and_an_x264_enabled_ffmpeg_of_the_same_machine_debian.html</link>
	<pubDate>Wed, 29 Jul 2009 08:44:54 +0100</pubDate>
	<description>&lt;b&gt;Oh and it has to be stable ish.&lt;/b&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;br style=&quot;clear:left;&quot;/&gt;Yesterday I had to try and get php-ffmpeg and  x264 enabled ffmpeg to sit side by side each other on a Debian Lenny install. The problem is that debian's ffmpeg that ships in the lenny package tree is not 264 enabled. But when you use the ffmpeg from &lt;a href=&quot;http://debian-multimedia.org/&quot; class=&quot;ng_url&quot;&gt;debian-multimedia&lt;/a&gt; it breaks the installed php-ffmpeg.&lt;br style=&quot;clear:left;&quot;/&gt;&lt;br style=&quot;clear:left;&quot;/&gt;So I suggest you do this:&lt;br style=&quot;clear:left;&quot;/&gt;&lt;br style=&quot;clear:left;&quot;/&gt;Start With vanilla debian install&lt;br style=&quot;clear:left;&quot;/&gt;&lt;br style=&quot;clear:left;&quot;/&gt;Install your php, apache, php-ffmpeg etc&lt;br style=&quot;clear:left;&quot;/&gt;&lt;br style=&quot;clear:left;&quot;/&gt;Then add your debian-multimedia.org as a apt source.&lt;br style=&quot;clear:left;&quot;/&gt;&lt;br style=&quot;clear:left;&quot;/&gt;Then follow these instructions&lt;br style=&quot;clear:left;&quot;/&gt;&lt;a href=&quot;http://tovid.wikia.com/wiki/Installing_svn_ffmpeg_on_a_Debian_based_distro&quot;&gt;http://tovid.wikia.com/wiki/Installing_svn_ffmpeg_on_a_Debian_based_distro&lt;/a&gt;&lt;br style=&quot;clear:left;&quot;/&gt;(I have attahed a pdf of the page incase its not there when you read this, &lt;a href=&quot;javascript:var blob = window.open('/data/8.html','_blank','scrollbars=1;menubar=no,height=750,width=680,resizable=yes,toolbar=no,location=no,status=no')&quot;&gt;Data: Instruction for compiling ffmpeg&lt;/a&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;br style=&quot;clear:left;&quot;/&gt;Happy Hunting</description>
</item>


	<item>
	<title>Large Webpage Screen Shots</title>
	<author>andrew@bluerhinos.co.uk  (Andrew Milsted)</author>
	<guid isPermaLink="true">http://blogs.bluerhinos.co.uk/thinkblue/23/Large_Webpage_Screen_Shots.html</guid>
	<link>http://blogs.bluerhinos.co.uk/thinkblue/23/Large_Webpage_Screen_Shots.html</link>
	<pubDate>Tue, 27 Jan 2009 22:53:11 +0000</pubDate>
	<description>&lt;span style=&quot;float:left;&quot;&gt;&lt;div class=&quot;dataPic datathumb&quot;  onclick=&quot;javascript:var blob = window.open('/data/6.html','_blank','scrollbars=1;menubar=no,height=750,width=680,resizable=yes,toolbar=no,location=no,status=no');&quot; style=&quot;width:99px; height:auto;&quot;&gt;&lt;div style=&quot;background-repeat: no-repeat; background-position: center center; background-image: url(/getdata.php?bit=6&amp;width=99&amp;height=212&amp;thumb=1); width:99px; height:212px; &quot;&gt;&lt;/div&gt;Example Screen Shot from the BBC&lt;/div&gt;&lt;/span&gt;Ever needed to create screen shots of websites like this one, but the site is longer that your screen resolution. Well I have found a simple tool that makes it easy in firefox. WebShots, a Firefox Addon, that allows you to save a screen shot at a click of a button,&lt;br style=&quot;clear:left;&quot;/&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;b&gt;Installation:&lt;/b&gt;&lt;br style=&quot;clear:left;&quot;/&gt;Go to &lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/6168&quot;&gt;https://addons.mozilla.org/en-US/firefox/addon/6168&lt;/a&gt; and click the &quot;Add to Firefox&quot; link. &lt;br style=&quot;clear:left;&quot;/&gt;Works on Windows, OS X and Linux</description>
</item>


	<item>
	<title>Plotting on a World Map</title>
	<author>andrew@bluerhinos.co.uk  (Andrew Milsted)</author>
	<guid isPermaLink="true">http://blogs.bluerhinos.co.uk/thinkblue/8/Plotting_on_a_World_Map.html</guid>
	<link>http://blogs.bluerhinos.co.uk/thinkblue/8/Plotting_on_a_World_Map.html</link>
	<pubDate>Wed, 07 Jan 2009 17:34:45 +0000</pubDate>
	<description>I needed to plot visitors to a web site onto a world map to demonstrate world wide coverage. I had an initial google around and couldn't really find anything. It didn't take too long to realise what i needed to make this work with my own script. I also chose to make it pretty so have gone for a lights at night look.&lt;br style=&quot;clear:left;&quot;/&gt;&lt;div class=&quot;dataPic datathumb&quot;  onclick=&quot;javascript:var blob = window.open('/data/2.html','_blank','scrollbars=1;menubar=no,height=750,width=680,resizable=yes,toolbar=no,location=no,status=no');&quot; style=&quot;width:700px; height:auto;&quot;&gt;&lt;div style=&quot;background-repeat: no-repeat; background-position: center center; background-image: url(/getdata.php?bit=2&amp;width=700&amp;height=350&amp;thumb=1); width:700px; height:350px; &quot;&gt;&lt;/div&gt;Plotting on a World Map (Website Visitors)&lt;/div&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;!--page--&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;b&gt;Problem&lt;/b&gt;&lt;br style=&quot;clear:left;&quot;/&gt;* Put locations of visitors (for which i already had in a mysql database) on to a world map.&lt;br style=&quot;clear:left;&quot;/&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;b&gt;Pre-Requisites&lt;/b&gt;&lt;br style=&quot;clear:left;&quot;/&gt;* The data (this example will assume from mysql)&lt;br style=&quot;clear:left;&quot;/&gt;* A World Map (I have gone for &quot;AVHRR Pathfinder&quot; shot from &lt;a href=&quot;http://www.evl.uic.edu/pape/data/Earth/&quot; class=&quot;ng_url&quot;&gt;here&lt;/a&gt;) the bigger the better) &lt;br style=&quot;clear:left;&quot;/&gt;* PHP with gd2 (I run this from the command line as it might take a while to render)&lt;br style=&quot;clear:left;&quot;/&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;b&gt;Understanding the Maths&lt;/b&gt;&lt;br style=&quot;clear:left;&quot;/&gt;Firstly to make this work you need a linear &lt;a href=&quot;http://en.wikipedia.org/wiki/Map_projection#Cylindrical&quot; class=&quot;ng_url&quot;&gt;cylindrical (latitude/longitude) projection&lt;/a&gt; world map, the ones from the source outlined above are. This means that the latitude/longitude are directly proportional to the x/y of the image. So if you have the dimensions the image as $img_x, $img_y you can then plot a long/lat with this:&lt;br style=&quot;clear:left;&quot;/&gt;&lt;pre class=&quot;php&quot; style=&quot;color: #000066; border: 1px solid #d0d0d0; background-color: #f0f0f0; padding:5px;&quot;&gt;&lt;div style=&quot;font-family: Verdana, Arial, sans-serif; color: #808080; font-size: 70%; font-weight: bold; border-bottom: 1px solid #d0d0d0; padding: 0px;&quot;&gt;php code:&lt;/div&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$pos_x&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;int&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$img_x&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'long'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;180&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$img_x&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$pos_y&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;int&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$img_y&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'lat'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;90&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$img_y&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;br style=&quot;clear:left;&quot;/&gt;For Longitude ($row['long']): the range is from -180°:180° so the above code work out the equivalent x position on the image. The same applies for Latitude($row['long']) with the range -90°:90°&lt;br style=&quot;clear:left;&quot;/&gt;&lt;br style=&quot;clear:left;&quot;/&gt;With this sorted the rest of the code is simple.&lt;br style=&quot;clear:left;&quot;/&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;b&gt;The Code&lt;/b&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;pre class=&quot;php&quot; style=&quot;color: #000066; border: 1px solid #d0d0d0; background-color: #f0f0f0; padding:5px;&quot;&gt;&lt;div style=&quot;font-family: Verdana, Arial, sans-serif; color: #808080; font-size: 70%; font-weight: bold; border-bottom: 1px solid #d0d0d0; padding: 0px;&quot;&gt;php code:&lt;/div&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;//Setup Image&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$imagein&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;PathfinderMap.jpg&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$imageout&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;output.jpg&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;nbsp;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;//Get Image Dimentions&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;a href=&quot;http://www.php.net/list&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;list&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$img_x&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$img_y&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;a href=&quot;http://www.php.net/getimagesize&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;getimagesize&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$imagein&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;nbsp;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;//Load in image&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$im&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; imagecreatefromjpeg&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$imagein&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;nbsp;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;//Make Image &amp;quot;Night time&amp;quot;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$darkblue&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; imagecolorallocatealpha&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$im&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; 0x00&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; 0x00&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; 0x00&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;25&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;imagefilledrectangle&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$im&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #000033;&quot;&gt;$img_x&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$img_y&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #000033;&quot;&gt;$darkblue&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;nbsp;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;//Mysql Bit&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$mysqli&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; mysqli&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;**&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;**&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;**&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;**&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$mysqli&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;connect_error&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;    &lt;a href=&quot;http://www.php.net/printf&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;printf&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;Connect failed: %sn&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; mysqli_connect_error&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;    &lt;a href=&quot;http://www.php.net/exit&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;exit&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;nbsp;&lt;br style=&quot;clear:left;&quot;/&gt;	&lt;span style=&quot;color: #000033;&quot;&gt;$sql&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;** Protected for Security **&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;nbsp;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;nbsp;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$result&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #000033;&quot;&gt;$mysqli&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;query&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$sql&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;nbsp;&lt;br style=&quot;clear:left;&quot;/&gt;    &lt;span style=&quot;color: #b1b100;&quot;&gt;while&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$row&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #000033;&quot;&gt;$result&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;fetch_array&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;MYSQLI_ASSOC&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;	&lt;br style=&quot;clear:left;&quot;/&gt;&amp;nbsp;&lt;br style=&quot;clear:left;&quot;/&gt;	&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;// work out long/lat on image&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;	&lt;span style=&quot;color: #000033;&quot;&gt;$pos_x&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;int&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$img_x&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'long'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;180&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$img_x&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;	&lt;span style=&quot;color: #000033;&quot;&gt;$pos_y&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;int&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$img_y&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'lat'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;90&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$img_y&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;nbsp;&lt;br style=&quot;clear:left;&quot;/&gt;	&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;//if two positions share the same pixel then combine the result &lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;	&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;!&lt;/span&gt;&lt;a href=&quot;http://www.php.net/isset&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;isset&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$data&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;{$pos_x}_{$pos_y}&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;		&lt;span style=&quot;color: #000033;&quot;&gt;$data&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;{$pos_x}_{$pos_y}&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #000033;&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'Rows'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;	&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;		&lt;span style=&quot;color: #000033;&quot;&gt;$data&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;{$pos_x}_{$pos_y}&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;+=&lt;/span&gt; &lt;span style=&quot;color: #000033;&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'Rows'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;	&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;nbsp;&lt;br style=&quot;clear:left;&quot;/&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;    &lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;//free result set &lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;    &lt;span style=&quot;color: #000033;&quot;&gt;$result&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;close&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;nbsp;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;nbsp;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;// close connection &lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$mysqli&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #004000;&quot;&gt;close&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;nbsp;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;//Size of data array&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$count&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;a href=&quot;http://www.php.net/count&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;count&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$data&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;nbsp;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;//debug&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;nbsp;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;foreach&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$data&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;as&lt;/span&gt; &lt;span style=&quot;color: #000033;&quot;&gt;$key&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$value&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;	&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;//Decides for each value&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;	&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;//	$yellow is the light color&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;	&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;//	$size is the diameter of the light&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;	&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$value&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;10000&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;		&lt;span style=&quot;color: #000033;&quot;&gt;$yellow&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; imagecolorallocatealpha&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$im&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; 0xFF&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; 0xFF&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; 0x00&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;		&lt;span style=&quot;color: #000033;&quot;&gt;$size&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;15&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;	&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;elseif&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$value&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;1000&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;		&lt;span style=&quot;color: #000033;&quot;&gt;$yellow&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; imagecolorallocatealpha&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$im&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; 0xFF&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; 0xFF&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; 0x00&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;		&lt;span style=&quot;color: #000033;&quot;&gt;$size&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;	&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;elseif&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$value&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;100&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;		&lt;span style=&quot;color: #000033;&quot;&gt;$yellow&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; imagecolorallocatealpha&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$im&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; 0xFF&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; 0xFF&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; 0x00&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;		&lt;span style=&quot;color: #000033;&quot;&gt;$size&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;7&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;	&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;		&lt;span style=&quot;color: #000033;&quot;&gt;$yellow&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; imagecolorallocatealpha&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$im&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; 0xFF&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; 0xFF&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; 0x00&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;		&lt;span style=&quot;color: #000033;&quot;&gt;$size&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;	&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;nbsp;&lt;br style=&quot;clear:left;&quot;/&gt;	&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;// Draw light&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;	&lt;a href=&quot;http://www.php.net/list&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;list&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$pos_x&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$pos_y&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;a href=&quot;http://www.php.net/split&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;split&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;_&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$key&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;	imagefilledellipse&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$im&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #000033;&quot;&gt;$pos_x&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #000033;&quot;&gt;$pos_y&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #000033;&quot;&gt;$size&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$size&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #000033;&quot;&gt;$yellow&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;nbsp;&lt;br style=&quot;clear:left;&quot;/&gt;	&lt;span style=&quot;color: #000033;&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;++;&lt;/span&gt; &lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;//Debug&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;	&lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\r&lt;/span&gt;$i/$count (&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;.&lt;/span&gt;&lt;a href=&quot;http://www.php.net/number_format&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;number_format&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$count&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;100&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;%)&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;nbsp;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\r&lt;/span&gt;Saving Image this could take a bit&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;//save Image &lt;/span&gt;&lt;br style=&quot;clear:left;&quot;/&gt;imagejpeg&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$im&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #000033;&quot;&gt;$imageout&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;br style=&quot;clear:left;&quot;/&gt;So there we go, I welcome any comments.</description>
</item>


	<item>
	<title>QRCode Button V1.0 Released</title>
	<author>andrew@bluerhinos.co.uk  (Andrew Milsted)</author>
	<guid isPermaLink="true">http://blogs.bluerhinos.co.uk/thinkblue/4/QRCode_Button_V10_Released.html</guid>
	<link>http://blogs.bluerhinos.co.uk/thinkblue/4/QRCode_Button_V10_Released.html</link>
	<pubDate>Thu, 01 Jan 2009 19:30:57 +0000</pubDate>
	<description>&lt;b&gt;What is the QRCode Button?&lt;/b&gt;&lt;br style=&quot;clear:left;&quot;/&gt;The QR Code Button is a simple tool, that easily allows you to add a qr code to your website/blog. &lt;br style=&quot;clear:left;&quot;/&gt;A QR Code is a matrix code (or two-dimensional bar code) created by Japanese corporation Denso-Wave in 1994. The &quot;QR&quot; is derived from &quot;Quick Response&quot;, as the creator intended the code to allow its contents to be decoded at high speed. QR Codes are common in Japan where they are currently the most popular type of two dimensional codes. The can be read by webcams and mobile phones, and can be used to store urls to websites and special offers.&lt;br style=&quot;clear:left;&quot;/&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;b&gt;How to use the QRCode Button?&lt;/b&gt;&lt;br style=&quot;clear:left;&quot;/&gt;To use the QR Code Button all you need to use a small amount of HTML.&lt;!--page--&gt;&lt;br style=&quot;clear:left;&quot;/&gt;&lt;pre style=&quot;color: #000066; border: 1px solid #d0d0d0; background-color: #f0f0f0; padding:5px;&quot;&gt;&lt;div style=&quot;font-family: Verdana, Arial, sans-serif; color: #808080; font-size: 70%; font-weight: bold; border-bottom: 1px solid #d0d0d0; padding: 0px;&quot;&gt;HTML code:&lt;/div&gt;&amp;lt;!-- qrcode Button BEGIN --&amp;gt;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br style=&quot;clear:left;&quot;/&gt;// Please put your url in here (can be left blank &lt;br style=&quot;clear:left;&quot;/&gt;// if you want hide your id)&lt;br style=&quot;clear:left;&quot;/&gt;  qrcode_user = 'http://example.com'&lt;SEMI&gt;  &lt;br style=&quot;clear:left;&quot;/&gt;&amp;lt;/script&amp;gt; &lt;br style=&quot;clear:left;&quot;/&gt;&amp;lt;a href=&amp;quot;http://www.bluerhinos.co.uk/qrcode/njs.php&amp;quot;  onclick=&amp;quot;return false&lt;SEMI&gt;&amp;quot;&lt;br style=&quot;clear:left;&quot;/&gt;  onmouseover=&amp;quot;return qrcode_open(this, 'http://example.com/')&amp;quot; &amp;gt;&lt;br style=&quot;clear:left;&quot;/&gt;    &amp;lt;img src=&amp;quot;http://www.bluerhinos.co.uk/qrcode/qr_img.png&amp;quot;  width=&amp;quot;16&amp;quot; height=&amp;quot;16&amp;quot;&lt;br style=&quot;clear:left;&quot;/&gt;         border=&amp;quot;0&amp;quot; alt=&amp;quot;QR Button From bluerhinos.co.uk&amp;quot; /&amp;gt;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;lt;/a&amp;gt; &lt;br style=&quot;clear:left;&quot;/&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;http://www.bluerhinos.co.uk/qrcode/qrcode_box.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br style=&quot;clear:left;&quot;/&gt;&amp;lt;!-- Qrcode Button END --&amp;gt;&lt;/pre&gt;&lt;br style=&quot;clear:left;&quot;/&gt;Just change the &quot;example.com&quot; to the uri you want to encode. &lt;br style=&quot;clear:left;&quot;/&gt;And you are Done, easy.&lt;br style=&quot;clear:left;&quot;/&gt;&lt;br style=&quot;clear:left;&quot;/&gt;Find out more from here: &lt;a href=&quot;http://bluerhinos.co.uk/qrcode/&quot;&gt;http://bluerhinos.co.uk/qrcode/&lt;/a&gt;</description>
</item>


	<item>
	<title>First Post</title>
	<author>andrew@bluerhinos.co.uk  (Andrew Milsted)</author>
	<guid isPermaLink="true">http://blogs.bluerhinos.co.uk/thinkblue/3/First_Post.html</guid>
	<link>http://blogs.bluerhinos.co.uk/thinkblue/3/First_Post.html</link>
	<pubDate>Thu, 18 Dec 2008 19:57:41 +0000</pubDate>
	<description>This is my first post, as you can proberbly see.&lt;br style=&quot;clear:left;&quot;/&gt;&lt;br style=&quot;clear:left;&quot;/&gt;This is going to be the place where I put my thoughts on things and some useful tips on my quest of scripting bits and bobs.</description>
</item>

</channel>
</rss>

