<?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>Blog Random &#187; Web dev</title>
	<atom:link href="http://www.blograndom.com/blog/category/web-dev/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.blograndom.com/blog</link>
	<description>Technology, website development, reviews and how-to's</description>
	<lastBuildDate>Sat, 07 May 2011 17:42:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>jQuery find next element in DOM by selector</title>
		<link>http://www.blograndom.com/blog/2011/04/jquery-find-next-element-in-dom-by-selector/</link>
		<comments>http://www.blograndom.com/blog/2011/04/jquery-find-next-element-in-dom-by-selector/#comments</comments>
		<pubDate>Fri, 01 Apr 2011 18:57:45 +0000</pubDate>
		<dc:creator>Cohen</dc:creator>
				<category><![CDATA[Web dev]]></category>

		<guid isPermaLink="false">http://www.blograndom.com/blog/?p=402</guid>
		<description><![CDATA[If you need to find the next occurrence of an element within the DOM, but aren&#8217;t sure where it is (i.e. you can&#8217;t just use $.next) I wrote a jQuery plugin that will traverse through the DOM from the current element til it hits either the &#8216;body&#8217; tag or a parent you specify. 1 2 [...]]]></description>
			<content:encoded><![CDATA[<p>If you need to find the next occurrence of an element within the DOM, but aren&#8217;t sure where it is (i.e. you can&#8217;t just use $.next) I wrote a jQuery plugin that will traverse through the DOM from the current element til it hits either the &#8216;body&#8217; tag or a parent you specify.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span> $ <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    $.<span style="color: #660066;">fn</span>.<span style="color: #660066;">nextElementInDom</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>selector<span style="color: #339933;">,</span> options<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003366; font-weight: bold;">var</span> defaults <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span> stopAt <span style="color: #339933;">:</span> <span style="color: #3366CC;">'body'</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
        options <span style="color: #339933;">=</span> $.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span>defaults<span style="color: #339933;">,</span> options<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #003366; font-weight: bold;">var</span> parent <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> found <span style="color: #339933;">=</span> parent.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span>selector<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">switch</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">case</span> <span style="color: #009900;">&#40;</span>found.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>
                <span style="color: #000066; font-weight: bold;">return</span> found<span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">case</span> <span style="color: #009900;">&#40;</span>parent.<span style="color: #660066;">length</span> <span style="color: #339933;">===</span> <span style="color: #CC0000;">0</span> <span style="color: #339933;">||</span> parent.<span style="color: #000066; font-weight: bold;">is</span><span style="color: #009900;">&#40;</span>options.<span style="color: #660066;">stopAt</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>
                <span style="color: #000066; font-weight: bold;">return</span> $<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #003366; font-weight: bold;">default</span><span style="color: #339933;">:</span>
                <span style="color: #000066; font-weight: bold;">return</span> parent.<span style="color: #660066;">nextElementInDom</span><span style="color: #009900;">&#40;</span>selector<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span> jQuery <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Download it here: <a href='http://www.blograndom.com/blog/wp-content/uploads/2011/04/jquery.nextElementInDom.js'>jquery.nextElementInDom.js</a></p>
<p>And here is how you would use it:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> elementNeeded <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.firstElement'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">nextElementInDom</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.secondElement'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Where your HTML might look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;firstElement&quot;</span>&gt;</span>Our first element<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
&nbsp;
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;secondElement&quot;</span>&gt;</span>Second element is in a different place<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.blograndom.com/blog/2011/04/jquery-find-next-element-in-dom-by-selector/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>php-ssrs v0.1</title>
		<link>http://www.blograndom.com/blog/2011/03/php-ssrs-v0-1/</link>
		<comments>http://www.blograndom.com/blog/2011/03/php-ssrs-v0-1/#comments</comments>
		<pubDate>Fri, 11 Mar 2011 00:04:42 +0000</pubDate>
		<dc:creator>Cohen</dc:creator>
				<category><![CDATA[SSRS]]></category>

		<guid isPermaLink="false">http://www.blograndom.com/blog/?p=396</guid>
		<description><![CDATA[A beta release of php-ssrs, a PHP SOAP client for Sql Reporting Services, that I helped write with Ideal Websites is now available for download. Grab a copy of it from the Google Code project page here: php-ssrs The QuickStart guide should be all you need to get going, there are also more detailed samples [...]]]></description>
			<content:encoded><![CDATA[<p>A beta release of php-ssrs, a PHP SOAP client for Sql Reporting Services, that I helped write with <a href="http://www.idealwebsites.co.uk">Ideal Websites</a> is now available for download.</p>
<p>Grab a copy of it from the Google Code project page here: <a href="http://code.google.com/p/php-ssrs/downloads/list">php-ssrs</a></p>
<p>The <a href="http://code.google.com/p/php-ssrs/wiki/QuickStart">QuickStart</a> guide should be all you need to get going, there are also more detailed samples available in the download. Getting a rendered report is made real easy, just take a look at the sample below:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$options</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
    <span style="color: #0000ff;">'username'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'testing'</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'password'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'password'</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$ssrs</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SSRS_Report<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'http://localhost/reportserver/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$options</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$ssrs</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">loadReport</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/Reports/Reference_Report'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$ssrs</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setSessionId</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">executionInfo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ExecutionID</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$ssrs</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setExecutionParameters</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> SSRS_Object_ExecutionParameters<span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">executionInfo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Parameters</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$ssrs</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">render</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'HTML4.0'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// PDF | XML | CSV</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$output</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.blograndom.com/blog/2011/03/php-ssrs-v0-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RB Internal Links v2.0.13</title>
		<link>http://www.blograndom.com/blog/2011/03/rb-internal-links-v2-0-13/</link>
		<comments>http://www.blograndom.com/blog/2011/03/rb-internal-links-v2-0-13/#comments</comments>
		<pubDate>Tue, 08 Mar 2011 19:13:58 +0000</pubDate>
		<dc:creator>Cohen</dc:creator>
				<category><![CDATA[RB Internal Links]]></category>

		<guid isPermaLink="false">http://www.blograndom.com/blog/?p=390</guid>
		<description><![CDATA[v2.0.13 (08/03/2011) Added support for custom post types WIKI style support for posts that don&#8217;t exist when logged in as an admin Class of &#8220;missingLink&#8221; applied to anchor of links with no post/page Show posts with a status of &#8216;post&#8217;, &#8216;draft&#8217;, &#8216;pending&#8217; or &#8216;future&#8217; in UI list Italian translation file]]></description>
			<content:encoded><![CDATA[<p><strong>v2.0.13 (08/03/2011)</strong></p>
<ul>
<li>Added support for custom post types</li>
<li>WIKI style support for posts that don&#8217;t exist when logged in as an admin</li>
<li>Class of &#8220;missingLink&#8221; applied to anchor of links with no post/page</li>
<li>Show posts with a status of &#8216;post&#8217;, &#8216;draft&#8217;, &#8216;pending&#8217; or &#8216;future&#8217; in UI list</li>
<li>Italian translation file</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.blograndom.com/blog/2011/03/rb-internal-links-v2-0-13/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ReportService2010.asmx is not the only SSRS 2008 R2 end point</title>
		<link>http://www.blograndom.com/blog/2011/03/reportservice2010-asmx-is-not-the-only-end-point/</link>
		<comments>http://www.blograndom.com/blog/2011/03/reportservice2010-asmx-is-not-the-only-end-point/#comments</comments>
		<pubDate>Fri, 04 Mar 2011 15:07:53 +0000</pubDate>
		<dc:creator>Cohen</dc:creator>
				<category><![CDATA[SSRS]]></category>
		<category><![CDATA[Web dev]]></category>

		<guid isPermaLink="false">http://www.blograndom.com/blog/?p=382</guid>
		<description><![CDATA[In our on-going quest to create a PHP SDK for Sql Reporing Services 2008 RS, we&#8217;ve shot ourselves in the foot by not reading the documentation properly. The end point documentation states that: The ReportService2005 and ReportService2006 endpoints are deprecated in SQL Server 2008 R2. The ReportService2010 endpoint includes the functionalities of both endpoints and [...]]]></description>
			<content:encoded><![CDATA[<p>In our on-going quest to create a PHP SDK for Sql Reporing Services 2008 RS, we&#8217;ve shot ourselves in the foot by not reading the documentation properly.</p>
<p>The <a href="http://msdn.microsoft.com/en-us/library/ms155398.aspx">end point documentation states</a> that:</p>
<blockquote><p>The <a href="http://msdn.microsoft.com/en-us/library/reportservice2005.aspx">ReportService2005</a> and <a href="http://msdn.microsoft.com/en-us/library/reportservice2006.aspx">ReportService2006</a> endpoints are deprecated in SQL Server 2008 R2. The <a href="http://msdn.microsoft.com/en-us/library/reportservice2010.aspx">ReportService2010</a> endpoint includes the functionalities of both endpoints and contains additional management features.</p></blockquote>
<p>We took this to mean that all end point functions were handled by ReportService2010.asmx but couldn&#8217;t find a way to render a report through this service. If we&#8217;d read down a little further we could have discovered that execution requests (i.e. <strong>rendering reports</strong>) is still handled by Report<strong>Execution</strong>2005.asmx</p>
<p>As the MSDN documentation concludes, there are three endpoints for Sql Server 2008 RS:</p>
<table>
<tbody>
<tr>
<td><a href="http://msdn.microsoft.com/en-us/library/reportservice2010.aspx">ReportService2010</a></td>
<td>Provides the APIs for managing a report server that is configured for either native or SharePoint integrated mode.</td>
</tr>
<tr>
<td><a href="http://msdn.microsoft.com/en-us/library/reportexecution2005.aspx">ReportExecution2005</a></td>
<td>Provides the APIs for running and navigating reports.</td>
</tr>
<tr>
<td><a href="http://msdn.microsoft.com/en-us/library/reportserviceauthentication.aspx">ReportServiceAuthentication</a></td>
<td>Provides the APIs for authenticating users against a report server when the SharePoint Web application is configured for Forms Authentication.</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.blograndom.com/blog/2011/03/reportservice2010-asmx-is-not-the-only-end-point/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sql Server Reporting Services SOAP API methods</title>
		<link>http://www.blograndom.com/blog/2011/03/sql-server-reporting-services-soap-api-methods/</link>
		<comments>http://www.blograndom.com/blog/2011/03/sql-server-reporting-services-soap-api-methods/#comments</comments>
		<pubDate>Thu, 03 Mar 2011 17:49:54 +0000</pubDate>
		<dc:creator>Cohen</dc:creator>
				<category><![CDATA[SSRS]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web dev]]></category>

		<guid isPermaLink="false">http://www.blograndom.com/blog/?p=377</guid>
		<description><![CDATA[We&#8217;re (trying) to use the SSRS SOAP API at work with a PHP application. We found an open source SDK over at codeplex but soon found it to be badly written, outdated and broken!! We were forced to write our own&#8230; It&#8217;s been an interesting process, and we hope to release our library as an [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re (trying) to use the SSRS SOAP API at work with a PHP application. We found an open source SDK over at codeplex but soon found it to be badly written, outdated and broken!! We were forced to write our own&#8230;</p>
<p>It&#8217;s been an interesting process, and we hope to release our library as an Open Source SDK as soon as possible but in the mean time, if you need the documentation and are struggling to find it on MSDN (like we did), its here: <a href="http://msdn.microsoft.com/en-us/library/reportservice2010.reportingservice2010.aspx">http://msdn.microsoft.com/en-us/library/reportservice2010.reportingservice2010.aspx</a></p>
<p>Hold out for our release, hopefully before the end of March 2011. If you&#8217;re interested in more information just leave a comment below!</p>
<p>P.S. That is the 2010 reference, which is what we&#8217;ll be coding for (i.e. ReportService2010.asmx?wsdl)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blograndom.com/blog/2011/03/sql-server-reporting-services-soap-api-methods/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP Kent</title>
		<link>http://www.blograndom.com/blog/2010/11/php-kent/</link>
		<comments>http://www.blograndom.com/blog/2010/11/php-kent/#comments</comments>
		<pubDate>Wed, 24 Nov 2010 17:35:03 +0000</pubDate>
		<dc:creator>Cohen</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web dev]]></category>

		<guid isPermaLink="false">http://www.blograndom.com/blog/?p=372</guid>
		<description><![CDATA[We&#8217;ve been struggling to fill a PHP development position at work and noticed a lack of community for PHP developers in the Kent area. There is PHP London and thats great, we head up there every month, but perhaps we could arrange an additional meetup closer to home! For now we just want to see [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve been struggling to fill a PHP development position at work and noticed a lack of community for PHP developers in the Kent area. There is PHP London and thats great, we head up there every month, but perhaps we could arrange an additional meetup closer to home!</p>
<p>For now we just want to see if we can find enough members (say 10+) to warrant starting the group, but as an additional service to agencies in Kent, we&#8217;ve set up a <a href="http://www.phpkent.org/jobs/">Kent PHP Job</a> board, that agencies can post available positions to for free! We&#8217;ll be vetting submissions to keep the jobs relevant!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blograndom.com/blog/2010/11/php-kent/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP vs Python array memory allocation</title>
		<link>http://www.blograndom.com/blog/2010/09/php-vs-python-array-memory-allocation/</link>
		<comments>http://www.blograndom.com/blog/2010/09/php-vs-python-array-memory-allocation/#comments</comments>
		<pubDate>Wed, 29 Sep 2010 17:39:40 +0000</pubDate>
		<dc:creator>Cohen</dc:creator>
				<category><![CDATA[Web dev]]></category>

		<guid isPermaLink="false">http://www.blograndom.com/blog/?p=358</guid>
		<description><![CDATA[I&#8217;ve been writing some import scripts for a system at work that will take data in either CSV, XLS, XML or a database (via Zend_Db), then store that data in a common format for us to manipulate and use for generating charts and tables. I quickly ran in to a problem using PHP, the memory [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been writing some import scripts for a system at work that will take data in either CSV, XLS, XML or a database (via Zend_Db), then store that data in a common format for us to manipulate and use for generating charts and tables.</p>
<p>I quickly ran in to a problem using PHP, the memory limit. If I import an excel file or database with over 25,000 rows of data I soon hit my memory limit (which on my dev box is set at 256MB!).</p>
<p>At first I looked for problems in my classes, then for memory leaks related to various php bugs. In the end, although I&#8217;d managed to cut memory usage down by a quarter, the app still uses way too much memory.</p>
<p>I decided to write a script to test how much memory PHP needed just to store this data in an array, not using my class based data sets. I used the following script:</p>
<blockquote><p>$data = array();<br />
for($i = 0; $i &lt; 10000; $i++){<br />
$data[] = array(&#8216;one&#8217;, &#8216;two&#8217;, &#8216;three&#8217;, &#8216;four&#8217;, &#8216;five&#8217;, &#8216;six&#8217;);<br />
}</p></blockquote>
<p>The result: 19MB!</p>
<p>If I compare the same sort of data structure in python:</p>
<blockquote><p>data = []<br />
count = 0</p>
<p>while (count &lt; 10000):<br />
data.append(['one', 'two', 'three', 'four', 'five', 'six'])<br />
count = count + 1</p></blockquote>
<p>The result: 1.39MB</p>
<p>The difference is huge. Unfortunately I think I&#8217;m going to have to use a different programming language to handle this part of the project, I don&#8217;t think PHP is up to the task. I am a huge fan of PHP, and use it for most things, but despite its need to remain flexible I can&#8217;t see why it needs so much memory!</p>
<p>I also produced a graph, I thought it would be pretty:</p>
<p><a href="http://www.blograndom.com/blog/wp-content/uploads/2010/09/PHP-Python-memory-chart-benchmark.png"><img class="alignleft size-full wp-image-360" title="PHP Python memory chart benchmark" src="http://www.blograndom.com/blog/wp-content/uploads/2010/09/PHP-Python-memory-chart-benchmark.png" alt="PHP Python memory chart benchmark" width="537" height="408" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.blograndom.com/blog/2010/09/php-vs-python-array-memory-allocation/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Cycling directions with hill gradient guide</title>
		<link>http://www.blograndom.com/blog/2010/09/cycling-directions-with-hill-gradient-guide/</link>
		<comments>http://www.blograndom.com/blog/2010/09/cycling-directions-with-hill-gradient-guide/#comments</comments>
		<pubDate>Thu, 23 Sep 2010 21:50:35 +0000</pubDate>
		<dc:creator>Cohen</dc:creator>
				<category><![CDATA[Web dev]]></category>

		<guid isPermaLink="false">http://www.blograndom.com/blog/?p=353</guid>
		<description><![CDATA[About two months ago I bought a road bike on the cycle to work scheme and have thoroughly enjoyed it. My route to work is really short so I&#8217;ve been working on distance rides at the weekend. So far my longest ride is 20 miles, but as that seemed a bit of a doddle, I&#8217;m [...]]]></description>
			<content:encoded><![CDATA[<p>About two months ago I bought a road bike on the cycle to work scheme and have thoroughly enjoyed it. My route to work is really short so I&#8217;ve been working on distance rides at the weekend. So far my longest ride is 20 miles, but as that seemed a bit of a doddle, I&#8217;m aiming for 40 this weekend. :s</p>
<p>As a newbie to cycling I like to plan my routes in advance and know what I&#8217;m up against, especially giant hills! I was excited to see <a href="http://googleblog.blogspot.com/2010/03/biking-directions-added-to-google-maps.html">Google has released cycling directions</a> for the US, hopefully it&#8217;ll hit the UK soon too. The maps team must have been real busy, because they&#8217;ve also released an <a href="http://code.google.com/apis/maps/documentation/elevation/">elevation API</a>.</p>
<p>Until cycling directions hit the UK I thought this was a great chance for a little mashup. I&#8217;ve used the google maps, directions and elevation APIs to create a little tool for planning cycling routes. What makes it special? It <a href="http://www.arronwoods.com/bikemap/">plots the cycle route with gradient</a> information, allowing you to foresee any giant climbs!</p>
<p>It needs more work but I wanted to get a prototype online. Check it out at <a href="http://www.arronwoods.com/bikemap/">http://www.arronwoods.com/bikemap/</a> &#8211; there is a todo list on there that should outline the vision I have for it. For now you should be able to enter a route and have it display inclines in red and declines in green along the route.</p>
<p>Feedback appreciated, just comment below.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blograndom.com/blog/2010/09/cycling-directions-with-hill-gradient-guide/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>RB Internal Links v2.0.12</title>
		<link>http://www.blograndom.com/blog/2010/06/rb-internal-links-v2-0-12/</link>
		<comments>http://www.blograndom.com/blog/2010/06/rb-internal-links-v2-0-12/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 23:50:40 +0000</pubDate>
		<dc:creator>Cohen</dc:creator>
				<category><![CDATA[Web dev]]></category>

		<guid isPermaLink="false">http://www.blograndom.com/blog/?p=345</guid>
		<description><![CDATA[A few months since the last update and not a lot has changed, but I&#8217;ve finally got around to sorting out the (very) annoying conflict issues. Instead of using wp_enqueue_scripts to load jquery, I&#8217;m just including it manually into the tinymce plugin popup. Now we won&#8217;t be plagued by compatibility issues from other plugins!! I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>A few months since the last update and not a lot has changed, but I&#8217;ve finally got around to sorting out the (very) annoying conflict issues. Instead of using wp_enqueue_scripts to load jquery, I&#8217;m just including it manually into the tinymce plugin popup.</p>
<p>Now we won&#8217;t be plagued by compatibility issues from other plugins!! <img src='http://www.blograndom.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I&#8217;ve had some feedback about the usability of the interface over the last few months. I&#8217;m going to come up with some ideas for making it far easier to use, I&#8217;d be very interested in more feedback and ideas on how to improve the popup interface. I&#8217;m thinking a complete overhaul, with no sliding and a larger area for selecting items but open to all ideas at this stage. Just comment below or post in the forums (<a href="http://blograndom.com/links/forum/">http://blograndom.com/links/forum/</a>).</p>
<p>Get the latest version of the plugin from <a href="http://wordpress.org/extend/plugins/rb-internal-links/">http://wordpress.org/extend/plugins/rb-internal-links/</a> while its hot.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blograndom.com/blog/2010/06/rb-internal-links-v2-0-12/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>PhpMyDiff v0.0.3</title>
		<link>http://www.blograndom.com/blog/2010/05/phpmydiff-v0-0-3/</link>
		<comments>http://www.blograndom.com/blog/2010/05/phpmydiff-v0-0-3/#comments</comments>
		<pubDate>Thu, 13 May 2010 21:39:18 +0000</pubDate>
		<dc:creator>Cohen</dc:creator>
				<category><![CDATA[Web dev]]></category>
		<category><![CDATA[diff]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[phpmydiff]]></category>

		<guid isPermaLink="false">http://www.blograndom.com/blog/?p=338</guid>
		<description><![CDATA[I had to use PhpMyDiff at work today for this first time in a while and managed to fix up a few bugs. I&#8217;ve also implemented a new way of comparing databases if the tables use the MyISAM engine. Rather than having to grab every row from the table and compare row by row, mysql [...]]]></description>
			<content:encoded><![CDATA[<p>I had to use PhpMyDiff at work today for this first time in a while and managed to fix up a few bugs. I&#8217;ve also implemented a new way of comparing databases if the tables use the MyISAM engine. Rather than having to grab every row from the table and compare row by row, mysql has a CHECKSUM function, which quickly returns the table checksum. If the checksums are different the original process (of grabbing the data) comes back in to play but for databases with only a few table changes, its a huge speed increase.</p>
<p>Given time I&#8217;d like to introduce a similar row by row checksum, which should be easy enough for tables with a primary key. PhpMyDiff is still a long way from complete, but it may slowly get there!</p>
<p>Oh, it should also be possible to compare any database type supported by Zend_Db now, although I haven&#8217;t had the chance to test this at all. I&#8217;m sure something will break, as a few of my queries are probably MySQL specific!!</p>
<p>Feedback would be great if anyone gets the time&#8230; check it out at <a href="http://code.google.com/p/phpmydiff/">http://code.google.com/p/phpmydiff/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.blograndom.com/blog/2010/05/phpmydiff-v0-0-3/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

