<?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>Max says... &#187; Development</title>
	<atom:link href="http://maxmanders.co.uk/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://maxmanders.co.uk</link>
	<description>thoughts of a web developer</description>
	<lastBuildDate>Wed, 08 Sep 2010 22:47:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Display Query Results Vertically With PostgreSQL</title>
		<link>http://maxmanders.co.uk/development/display-query-results-vertically-with-postgresql/</link>
		<comments>http://maxmanders.co.uk/development/display-query-results-vertically-with-postgresql/#comments</comments>
		<pubDate>Tue, 04 May 2010 13:03:55 +0000</pubDate>
		<dc:creator>maxmanders</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://maxmanders.co.uk/general/display-query-results-vertically-with-postgresql/</guid>
		<description><![CDATA[Those who are familiar with MySQL may be used to terminating a query with &#8216;\G&#8217; to have the client output the query results vertically with each column/value pair a line at a time. There is in a equivalent in PostgreSQL too. The psql client uses &#8216;\x&#8217; to toggle vertical output, and &#8216;\g&#8217; to send the [...]]]></description>
			<content:encoded><![CDATA[<p>Those who are familiar with MySQL may be used to terminating a query with &#8216;\G&#8217; to have the client output the query results vertically with each column/value pair a line at a time.  There is in a equivalent in PostgreSQL too.  The psql client uses &#8216;\x&#8217; to toggle vertical output, and &#8216;\g&#8217; to send the current buffer to the server for processing.  To get the same effect in psql as &#8216;\G&#8217; in MySQL, just end your query with &#8216;\x\g\x&#8217;.</p>
]]></content:encoded>
			<wfw:commentRss>http://maxmanders.co.uk/development/display-query-results-vertically-with-postgresql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UK Geocoding &#8211; Update</title>
		<link>http://maxmanders.co.uk/development/uk-geocoding-update/</link>
		<comments>http://maxmanders.co.uk/development/uk-geocoding-update/#comments</comments>
		<pubDate>Sun, 11 Apr 2010 16:22:51 +0000</pubDate>
		<dc:creator>maxmanders</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[YQL]]></category>

		<guid isPermaLink="false">http://maxmanders.co.uk/?p=171</guid>
		<description><![CDATA[I&#8217;ve updated the UK Geocoding site to provide better documentation, and a UI for geocoding, in addition to the XML API.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve updated the <a href="http://ukgeocode.maxmanders.co.uk/">UK Geocoding site</a> to provide better documentation, and a UI for geocoding, in addition to the XML API.</p>
]]></content:encoded>
			<wfw:commentRss>http://maxmanders.co.uk/development/uk-geocoding-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UK Geocoding</title>
		<link>http://maxmanders.co.uk/development/uk-geocoding/</link>
		<comments>http://maxmanders.co.uk/development/uk-geocoding/#comments</comments>
		<pubDate>Sat, 10 Apr 2010 12:40:05 +0000</pubDate>
		<dc:creator>maxmanders</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[YQL]]></category>

		<guid isPermaLink="false">http://maxmanders.co.uk/?p=166</guid>
		<description><![CDATA[After a little hard work, I&#8217;m releasing my attempt to address the shortfall in accurate UK geocoding services.  Courtesy of open data provided by Ordnance Survey Open Click-Point, some sed, SQLite, PHP and YQL I&#8217;ve produced a REST API, and a YQL datatable.  I&#8217;ve also written a more thorough account of this by way of [...]]]></description>
			<content:encoded><![CDATA[<p>After a little hard work, I&#8217;m releasing my attempt to address the shortfall in accurate UK geocoding services.  Courtesy of open data provided by Ordnance Survey Open Click-Point, some sed, SQLite, PHP and YQL I&#8217;ve produced a REST API, and a YQL datatable.  I&#8217;ve also written <a title="UK Geocoding" href="http://maxmanders.co.uk/uk-geocode/">a more thorough account</a> of this by way of documenation.</p>
]]></content:encoded>
			<wfw:commentRss>http://maxmanders.co.uk/development/uk-geocoding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find Excluding SVN</title>
		<link>http://maxmanders.co.uk/development/find-exclusing-svn/</link>
		<comments>http://maxmanders.co.uk/development/find-exclusing-svn/#comments</comments>
		<pubDate>Fri, 24 Oct 2008 15:13:34 +0000</pubDate>
		<dc:creator>maxmanders</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://maxmanders.co.uk/?p=101</guid>
		<description><![CDATA[So, you need to take a copy of a subversion working copy, but it has local changes that you also need to copy.  This precludes the use of `svn export` since the local changes won&#8217;t be included.  One option is to do an `svn export` anyway, and then `cp -ra` the local changes.  Another solution [...]]]></description>
			<content:encoded><![CDATA[<p>So, you need to take a copy of a subversion working copy, but it has local changes that you also need to copy.  This precludes the use of `svn export` since the local changes won&#8217;t be included.  One option is to do an `svn export` anyway, and then `cp -ra` the local changes.  Another solution is to use a find command that excludes subversion metadata, and then copy the resulting files:</p>
<p>`find . -path &#8216;*/.svn&#8217; -prune -o -type f -print`</p>
<p>I did something similar some time ago, but forgot the command, so here it is for posterity.</p>
]]></content:encoded>
			<wfw:commentRss>http://maxmanders.co.uk/development/find-exclusing-svn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The New Look</title>
		<link>http://maxmanders.co.uk/development/the-new-look/</link>
		<comments>http://maxmanders.co.uk/development/the-new-look/#comments</comments>
		<pubDate>Fri, 07 Mar 2008 19:00:32 +0000</pubDate>
		<dc:creator>maxmanders</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://maxmanders.co.uk/design/the-new-look/</guid>
		<description><![CDATA[I decided some time ago that I wasn&#8217;t happy with the way this site looked.  Unfortunately I haven&#8217;t had much time to do anything about it.  I&#8217;ve finally got around to making some changes, the most important of which you may notice is the minimalist design.  I don&#8217;t know if I plan to change this [...]]]></description>
			<content:encoded><![CDATA[<p>I decided some time ago that I wasn&#8217;t happy with the way this site looked.  Unfortunately I haven&#8217;t had much time to do anything about it.  I&#8217;ve finally got around to making some changes, the most important of which you may notice is the minimalist design.  I don&#8217;t know if I plan to change this any time in the future, but for now it will do.</p>
<p>I&#8217;ve also tried to pull in some data from other services I use (perhaps not as frequently as I would like) such as Twitter, Facebook and Flickr.  To that end, my recent Twitter tweets are now displayed, together with my Facebook status.  I&#8217;ve also pulled in some random images from my public Flickr collection.</p>
]]></content:encoded>
			<wfw:commentRss>http://maxmanders.co.uk/development/the-new-look/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH Tunneling</title>
		<link>http://maxmanders.co.uk/development/ssh-tunnelling/</link>
		<comments>http://maxmanders.co.uk/development/ssh-tunnelling/#comments</comments>
		<pubDate>Fri, 18 Jan 2008 19:41:44 +0000</pubDate>
		<dc:creator>maxmanders</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://maxmanders.co.uk/linux/ssh-tunnelling/</guid>
		<description><![CDATA[Another aide memoire, but again may be useful to some. I&#8217;d like the ability to work from home on some web development projects I&#8217;m doing at work. Getting the code locally is not a problem thanks to Subversion over ssh However viewing the results can be tricky when you consider that the development server is [...]]]></description>
			<content:encoded><![CDATA[<p>Another aide memoire, but again may be useful to some.  I&#8217;d like the ability to work from home on some web development projects I&#8217;m doing at work.  Getting the code locally is not a problem thanks to Subversion over ssh  However viewing the results can be tricky when you consider that the development server is behind the work network.  The answer is SSH tunneling.</p>
<p>Let&#8217;s say you can access SERVER_A directly over ssh  The service you want to access is on SERVER_B which you can&#8217;t access directly via SSH from your local machine.  However, you can access SERVER_B from SERVER_A.  I&#8217;ll assume that you want to access the service locally on port 12345, and that the remove port is port 80.  The following command will allow you to access a service on SERVER_B from your local machine.</p>
<p><code>ssh -Nf -L 12345:SERVER_B:80 username@SERVER_A</code></p>
<p>The &#8216;-Nf&#8217; switch says don&#8217;t execute a command with this ssh session, and run this ssh process in the background.  The first port is the port you want to use locally; the first server is the usually inaccessible remote server you want access to; and the third port is the remote port you want to use.  The final argument gives the login to the remotely accessible server you have ssh access to directly.</p>
<p>One caveat to this is if you are trying to access a web site that is defined using Apache virtual hosts.  With this command alone, requesting localhost:12345 in Firefox would only direct you to the site that is listening remotely for requests that match &#8216;localhost&#8217;.  If you would ordinarily access this site using mysite.server_b, then you need to use that as the address in Firefox on your local machine.  Therefore, this needs to be added in /etc/hosts.  With that done, you should be able to request mysite.server_b:12345 in Firefox and be directed to the remote &#8220;virtual host&#8221; site.</p>
]]></content:encoded>
			<wfw:commentRss>http://maxmanders.co.uk/development/ssh-tunnelling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Analysing Oracle Application Server 9i Webcache Logs</title>
		<link>http://maxmanders.co.uk/development/analysing-oracle-application-server-9i-webcache-logs/</link>
		<comments>http://maxmanders.co.uk/development/analysing-oracle-application-server-9i-webcache-logs/#comments</comments>
		<pubDate>Wed, 22 Aug 2007 16:47:47 +0000</pubDate>
		<dc:creator>maxmanders</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://maxmanders.co.uk/development/analysing-oracle-application-server-9i-webcache-logs/</guid>
		<description><![CDATA[Recently I had cause to report on the usage staff at work made of the corporate intranet. This would ordinarily be a simple enough task if the logs were plain standard Apache logs. However, I was dealing with Oracle9iAS, a very different beast indeed. Oracle9iAS is built on top of a customised version of Apache [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I had cause to report on the usage staff at work made of the corporate intranet. This would ordinarily be a simple enough task if the logs were plain standard Apache logs. However, I was dealing with Oracle9iAS, a very different beast indeed.  Oracle9iAS is built on top of a customised version of Apache and incorporates a caching proxy server, the so-called Webcache; an implementation of J2EE called OC4J (Oracle Containers for Java) and various other bells and whistles, making it something of a behamoth.<span id="more-49"></span></p>
<p>Because we use the Webcache, I would need to analyse the Webcache access logs for a representative picture of what people are requesting.  However, the Webcache does not use a single log file; it uses rolling log files for each day named &lt;access_log.YYYYMMDD&gt;.  Also, Webcache does not use a standardised logfile format, it uses a format unique (as far as I know) to Oracle.</p>
<p>My task was to extract the relevant data from the various logfiles. I was only interested in &#8220;pages&#8221; from Oracle Portal.  In this case, a page is a specific Oracle Portal entity, rather than a more genereal web page as you might think.  I wrote a small Perl script to grab the necessary lines from each logfile and write them to a file that I would later process with Analog.</p>
<pre lang="Perl">
#!/usr/bin/perl</code>

# USE directives
use Time::Local;
use File::Find;
use Cwd;

# -----------------------------------------------

# Get elements of the current datetime
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time);
my $cwd = getcwd();
my $extension;
my $regex;
my $line;
my $pause;
my $thisfile;

# Convert year to four digit YYYY format rather than 'year - 1900'
$year = $year + 1900;

# If the month is January, i.e. $mon == 0, then we need to process log files
# from the previous year as well as the previous month, i.e. December or
# $mon == 12.
if ($mon == 0)
{
  $mon = 12;
  $year -= 1;
}

# Construct logfile extension as YYYYMM where MM is previous MM.
$extension = length($mon) == 1 ? "$year" . "0" . $mon : "$year" . $mon;

# File to output results to.
$outfile = "input.log";

# Regex to match Portal page URIs.
$regex = '^.*\t/portal/page\?_pageid.*$';

# Run File::Find::find() against each file in the current directory.
find(\&amp;get_date, $cwd);

##
# Callback function for File::Find
# This function is called for every file found in $cwd
##
sub get_date
{
  my $line;
  my @output_list;
  my @input_list;

  # only read log files for previous month
  if ($File::Find::name =~ /access_log\.$extension.*$/)
  {
    $thisfile = $File::Find::name;

    # test whether the file we are looking at is a compressed
    # file or not
    if ((substr($File::Find::name, -1)) eq "Z")
    {
      # if it is compressed, uncompress it and
      # take name of file without .Z as the file
      # to operate on afterwards
      print "Uncompressing $File::Find::name...";
      system("uncompress $File::Find::name");
      $thisfile = substr($File::Find::name, 0, -2);
    }
    print "$thisfile\n";
    open(IN_FILE, $thisfile) or die ("Cannot Open File: $!\n");
    open(OUT_FILE, "&gt;&gt;$outfile") or die ("Cannot Open File: $!\n");
    while ($line = <in_file>)
    {
      if ($line =~ $regex)
      {
        print $line;
        print OUT_FILE ($line);
      }
    }
    close(IN_FILE);
    close(OUT_FILE);</in_file>

    if ((substr($File::Find::name, -1)) eq "Z")
    {
      # If we uncompressed a compressed file then
      # we must now recompress it.
      $zipfile = substr($File::Find::name, 0, -2);
      print "Compressing $zipfile...";
     system("compress $zipfile");
    }
  }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://maxmanders.co.uk/development/analysing-oracle-application-server-9i-webcache-logs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A First WordPress Plugin</title>
		<link>http://maxmanders.co.uk/development/a-first-wordpress-plugin/</link>
		<comments>http://maxmanders.co.uk/development/a-first-wordpress-plugin/#comments</comments>
		<pubDate>Tue, 21 Aug 2007 22:41:48 +0000</pubDate>
		<dc:creator>maxmanders</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://maxmanders.co.uk/development/a-first-wordpress-plugin/</guid>
		<description><![CDATA[As you can see from my previous post, my first attempt at writing a WordPress Plugin was a success. This plugin is very simple and allows the user to embed a YouTube video into their post. The main function calls a callback function that replaces every occurrence of the tag ["youtube" video_id] (minus quotes) with [...]]]></description>
			<content:encoded><![CDATA[<p>As you can see from my previous post, my first attempt at writing a WordPress Plugin was a success.  This plugin is very simple and allows the user to embed a YouTube video into their post.  The main function calls a callback function that replaces every occurrence of the tag ["youtube" video_id] (minus quotes) with a flash video corresponding to the video_id parameter.</p>
<p>Just paste the code below into a file called &#8216;youtube.php&#8217; in your wp-content/plugins directory. You should then be able to activate it via the Plugins admin option.  Once activated, you can place a YouTube video in your post by going to code-view and inserting  ["youtube" video_id] (minus the quotes). The video_id parameter is the &#8216;v&#8217; parameter in a YouTube URL. In the example below, the URL is http://www.youtube.com/watch?v=lL4L4Uv5rf0.  Therefore, the video_id parameter should be lL4L4Uv5rf0.  In the code below, you will need to remove the quotes around the word &#8220;youtube&#8221; in the regex on line 5, I had to put these in to display the code without it interpreting the tag&#8230; it&#8217;s a work in progress!</p>
<pre lang="php">

define("YOUTUBE_WIDTH", 425);
define("YOUTUBE_HEIGHT", 350);
define("YOUTUBE_TAG", "/["youtube" ([[:print:]]+)]/");
define("YOUTUBE_LINK", "<object type="\" data="\" height="\" width="\"><param name="\" value="\"></param></object>");

function youtube_plugin_cb($match)
{
$html = YOUTUBE_LINK;
$html = str_replace("###YOUTUBE_ID###", $match[1], $html);
return ($html);
}

function youtube_plugin($content)
{
return (preg_replace_callback(YOUTUBE_TAG, 'youtube_plugin_cb', $content));
}

add_filter('the_content', 'youtube_plugin');
add_filter('comment_text', 'youtube_plugin');

?&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://maxmanders.co.uk/development/a-first-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java &#8211; this and that</title>
		<link>http://maxmanders.co.uk/development/java-this-and-that/</link>
		<comments>http://maxmanders.co.uk/development/java-this-and-that/#comments</comments>
		<pubDate>Thu, 16 Aug 2007 09:47:42 +0000</pubDate>
		<dc:creator>maxmanders</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://maxmanders.co.uk/general/java-this-and-that/</guid>
		<description><![CDATA[My work has recently taken a departure from the usual web development as I&#8217;ve been &#8220;borrowed&#8221; by the other development team to help out with a Java project. Now, my Java is reasonable sound but yesterday I came across a curious situation involving passing about the current object. In common with a lot of languages, [...]]]></description>
			<content:encoded><![CDATA[<p>My work has recently taken a departure from the usual web development as I&#8217;ve been &#8220;borrowed&#8221; by the other development team to help out with a Java project.  Now, my Java is reasonable sound but yesterday I came across a curious situation involving passing about the current object.</p>
<p>In common with a lot of languages, the current object is represented by the &#8216;this&#8217; keyword.  I wanted to pass &#8216;this&#8217; to a static method of another class.  Of course, I can&#8217;t refer to the object as &#8216;this&#8217; in the static method context as that would be ambiguous insofar as it could refer to the class with the static method I&#8217;m working with.  This pattern is often used with callbacks where for example you might want to register a class with a particular listener objcet.  To avoid confusion, I named the actual parameter in the static method</p>
<pre lang="Java">that</pre>
<p>I assumed that I would reference the fields and methods of the object using</p>
<pre lang="Java">that.someMethod()</pre>
<p>rather than</p>
<pre lang="Java">this.someMethod()</pre>
<p>This is where the fun begins.  Let&#8217;s call the original object</p>
<pre lang="Java">SomeObject theObject</pre>
<p>and I want to call the static method</p>
<pre lang="Java">SomeClass.doStaticMethod(SomeObject that)</pre>
<p>I would call that method, from within theObject, using</p>
<pre lang="Java">SomeClass.doStaticMethod(this)</pre>
<p>When in theObject, I have access to private fields and methods since private fields and methods are within scope.  I assumed the same would be true when I passed &#8220;theObject&#8221; as &#8220;this&#8221; to &#8220;SomeClass.doStaticMethod(SomeObject that)&#8221;.  However, when I actually try to access private fields such as &#8220;that.privateField&#8221;, it would appear that I no longer have access.  I could create appropriate accessor methods, but that would defeat the idea of encapsulation.</p>
<p>Does anyone have any ideas?  Am I missing some fundamental (and so obvious I missed it) rule of scope or object passing?</p>
]]></content:encoded>
			<wfw:commentRss>http://maxmanders.co.uk/development/java-this-and-that/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Symfony Woes</title>
		<link>http://maxmanders.co.uk/development/symfony-woes/</link>
		<comments>http://maxmanders.co.uk/development/symfony-woes/#comments</comments>
		<pubDate>Wed, 15 Aug 2007 20:12:03 +0000</pubDate>
		<dc:creator>maxmanders</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://maxmanders.co.uk/general/symfony-woes/</guid>
		<description><![CDATA[I&#8217;ve finally found time to start investigating some other PHP frameworks, and after some brief research I decided to start off with Symfony. All is going well and so far I&#8217;m impressed with what Symfony can do compared with CakePHP&#8230; with a few exceptions. I initially tried following the My First Project tutorial, but hit [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve finally found time to start investigating some other PHP frameworks, and after some brief research I decided to start off with <a href="http://www.symfony-project.com">Symfony</a>.  All is going well and so far I&#8217;m impressed with what Symfony can do compared with CakePHP&#8230; with a few exceptions.</p>
<p>I initially tried following the My First Project tutorial, but hit problems pretty quickly.  It would seem that there was a problem with the PHP SQLite extension.  The phpinfo() function verified that SQLite was indeed installed, but I couldn&#8217;t get any further on that trail.  After reading a number of forum posts on the issue, it became apparent I should recompile Apache and PHP.  I&#8217;m still not that confident with Linux to do that so I left it at that.</p>
<p>Then I followed the Askeet tutorial with more success as this tutorial uses MySQL rather than SQLite.  However, I can&#8217;t get the URL rewriting to work as it should.  I&#8217;ve checked my Apache configuration, the .htacces file and still no luck. If I load http://&lt;project&gt;/question I get a 404 error.  If I load http://&lt;project&gt;/index.php/question or http://&lt;project&gt;/frontend_dev.php/question all is well.  I&#8217;ll press on with this tutorial until I hit a road block, but this is really bugging me.  Again, a few forum posts suggest recompiling Apache and PHP.  However, the extensions that should be included in the new build are already present according to phpinfo().</p>
<p>I&#8217;m currently running Fedora 7 which installs Apache and PHP in its own odd way.  Perhaps I should start from scratch by  removing Apache and PHP with yum and compiling both from source.  Although as I said I&#8217;m kind of reluctant to do that.  If anyone has any ideas &#8211; let me know!</p>
]]></content:encoded>
			<wfw:commentRss>http://maxmanders.co.uk/development/symfony-woes/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
