<?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"
	>

<channel>
	<title>Grantus Maximus Web Blog</title>
	<atom:link href="http://grantusmaximus.com/web/feed/" rel="self" type="application/rss+xml" />
	<link>http://grantusmaximus.com/web</link>
	<description></description>
	<pubDate>Wed, 18 Jun 2008 04:07:16 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>Most downloads Guniess World Record in progress&#8230;</title>
		<link>http://grantusmaximus.com/web/2008/06/18/most-downloads-guniess-world-record-in-progress/</link>
		<comments>http://grantusmaximus.com/web/2008/06/18/most-downloads-guniess-world-record-in-progress/#comments</comments>
		<pubDate>Wed, 18 Jun 2008 04:06:12 +0000</pubDate>
		<dc:creator>Grant Perry</dc:creator>
		
		<category><![CDATA[Browsers]]></category>

		<guid isPermaLink="false">http://grantusmaximus.com/web/?p=39</guid>
		<description><![CDATA[So the day arrives Firefox 3 has finally been released&#8230; I can&#8217;t say it was in my diary but it must have been in some others, apparently their FTP servers were down in the hours leading up to the release&#8230; Suspect some geeks (and I use the word affectionately) were trying to get an early [...]]]></description>
			<content:encoded><![CDATA[<p>So the day arrives Firefox 3 has finally been released&#8230; I can&#8217;t say it was in my diary but it must have been in some others, apparently their FTP servers were down in the hours leading up to the release&#8230; Suspect some geeks (and I use the word affectionately) were trying to get an early copy!</p>
<p>With this release Mozilla has taken an interesting marketing approach - trying to break (or set?) a guniess world record with the most downloads. Anyway &#8217;spread the word&#8217; as they say.. <a href="check out the release to play your small part,">check out Firefox 3.0 to play your small part in a world record</a>.</p>
<p>3 Million and counting on its first day isn&#8217;t bad!</p>
<span class="akst_link"><a href="http://grantusmaximus.com/web/?p=39&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_39"  class="akst_share_link">Share bookmark</a>
</span>]]></content:encoded>
			<wfw:commentRss>http://grantusmaximus.com/web/2008/06/18/most-downloads-guniess-world-record-in-progress/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PayPal&#8217;s Credit Card processing down for 8 hrs (and counting)</title>
		<link>http://grantusmaximus.com/web/2008/05/30/paypals-credit-card-processing-down-for-8-hrs-and-counting/</link>
		<comments>http://grantusmaximus.com/web/2008/05/30/paypals-credit-card-processing-down-for-8-hrs-and-counting/#comments</comments>
		<pubDate>Fri, 30 May 2008 12:07:37 +0000</pubDate>
		<dc:creator>Grant Perry</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[e-Business]]></category>

		<guid isPermaLink="false">http://grantusmaximus.com/web/?p=38</guid>
		<description><![CDATA[Like I assume millions of other people, I&#8217;ve been unable to make a payment with PayPal for over 8 hours now. The following error message appear on the PayPal website when trying to make a payment with a credit card&#8230;
The PayPal site is currently experiencing technical difficulties with our credit card processor. We are working [...]]]></description>
			<content:encoded><![CDATA[<p>Like I assume millions of other people, I&#8217;ve been unable to make a payment with PayPal for over 8 hours now. The following error message appear on the PayPal website when trying to make a payment with a credit card&#8230;</p>
<blockquote><p>The PayPal site is currently experiencing technical difficulties with our credit card processor. We are working to solve this problem as quickly as possible. If you would like to use your credit card, please return to the PayPal website later to complete your transaction. We apologise for any inconvenience this may cause.</p></blockquote>
<p>Quite a concern considering eBay is now making it mandatory for all auctions to include PayPal as a means of payment. And as of July this goes one step further with PayPal being the only option to pay an eBay seller.</p>
<span class="akst_link"><a href="http://grantusmaximus.com/web/?p=38&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_38"  class="akst_share_link">Share bookmark</a>
</span>]]></content:encoded>
			<wfw:commentRss>http://grantusmaximus.com/web/2008/05/30/paypals-credit-card-processing-down-for-8-hrs-and-counting/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Online banking error in my favour, collect $1000, enjoy!</title>
		<link>http://grantusmaximus.com/web/2008/02/21/online-banking-error-in-my-favour-collect-1000-enjoy/</link>
		<comments>http://grantusmaximus.com/web/2008/02/21/online-banking-error-in-my-favour-collect-1000-enjoy/#comments</comments>
		<pubDate>Thu, 21 Feb 2008 04:48:37 +0000</pubDate>
		<dc:creator>Grant Perry</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://grantusmaximus.com/web/2008/02/21/online-banking-error-in-my-favour-collect-1000-enjoy/</guid>
		<description><![CDATA[While using  Commonwealth Bank&#8217;s online bank NetBank last week I transferred over $1000 on to  my Credit Card. I didn&#8217;t owe anything on this credit card I just wanted the  funds on there to use&#8230; Since then I&#8217;d noticed my Available balance was on  top $2000 of my limit&#8230;
Really confused  [...]]]></description>
			<content:encoded><![CDATA[<p>While using  Commonwealth Bank&#8217;s online bank NetBank last week I transferred over $1000 on to  my Credit Card. I didn&#8217;t owe anything on this credit card I just wanted the  funds on there to use&#8230; Since then I&#8217;d noticed my Available balance was on  top $2000 of my limit&#8230;</p>
<p>Really confused  thinking the bank had screwed up and increased my limit without my authorisation  I gave them a call. Just off the phone and I&#8217;ve found out they currently have a  sporadic error occurring on NetBank.</p>
<p>Basically some  transfers being made between accounts are registering the deposit twice, and the  withdrawal once!! I.e. I was withdrawing $1000 and depositing it on my card, but  it was registering 2 deposits.. so $2000 in total&#8230; CHING  CHING!</p>
<p>The phone operator  corrected the error despite me insisting it be left how it was <img src='http://www.grantusmaximus.com/web/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> He also said  the problem would have been corrected in a couple of days anyway - but I wonder  whether it really would have?</p>
<p>This is just one  VERY good example of why you should build thorough logging in to your web  applications for auditing purposes. Just think the amount of money this bank  would be losing is they hadn&#8217;t!! Or perhaps are if they are relying on fools  like me to point out their mistakes.</p>
<span class="akst_link"><a href="http://grantusmaximus.com/web/?p=36&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_36"  class="akst_share_link">Share bookmark</a>
</span>]]></content:encoded>
			<wfw:commentRss>http://grantusmaximus.com/web/2008/02/21/online-banking-error-in-my-favour-collect-1000-enjoy/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Image storage: Database BLOB Vs. File system</title>
		<link>http://grantusmaximus.com/web/2008/02/08/image-storage-database-blob-vs-file-system/</link>
		<comments>http://grantusmaximus.com/web/2008/02/08/image-storage-database-blob-vs-file-system/#comments</comments>
		<pubDate>Fri, 08 Feb 2008 03:11:14 +0000</pubDate>
		<dc:creator>Grant Perry</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://grantusmaximus.com/web/2008/02/08/image-storage-database-blob-vs-file-system/</guid>
		<description><![CDATA[This raises an age old question which will  likely be debated for many years to come. Ultimately both methods of storage  have their benefits and costs.
Storing images on the file system has a  marginally faster retrieval rate, thanks to web and proxy servers being good at what they  do.
Storing images in [...]]]></description>
			<content:encoded><![CDATA[<p>This raises an age old question which will  likely be debated for many years to come. Ultimately both methods of storage  have their benefits and costs.</p>
<p>Storing images on the file system has a  marginally faster retrieval rate, thanks to web and proxy servers being good at what they  do.</p>
<p>Storing images in a database allows for all of  your data to be central stored which is more portable, and easy to replicate.  This solution would likely also be easier for taking a point-in-time backup with  referential integrity.</p>
<p>Which option you choose would really depend on the type application you&#8217;re building in my opinion.</p>
<p>So if you&#8217;re  building an application with a moderately sized amount of image data, and  moderate amount of traffic using a database would be okay as the benefits outway  the cost. However if you&#8217;re building something like <em>flickr</em> with large amounts of  data and high traffic, using the file system would be the advised  approach.</p>
<p>I&#8217;ve also heard of  a combined solution that could provide the best of both world. This is storing  your images in the database to gain the benefits there, but also use filesystem  caching of these to obtain the performance benefits.</p>
<p>For a senario of a small photo storage site with 2 Gig of images, I would recommend the filesystem approach or consider  attempting the combined solution. Although at only 2 Gig either approach would be  fine&#8230; but we need to allow for some growth, it could boom  right?</p>
<p>Some tips for getting  the best performance out of the filesystem:</p>
<ul>
<li>Limit the  number of images in any one directory (or suffer performance  loss)</li>
<li>Include not  only an image identifier in the filename, but also a secret code (to prevent  discovering files)</li>
</ul>
<p>See the following  website has some great information on <strong>flickr</strong>:</p>
<p><a href="http://www.linkedin.com/redirect?url=http%3A%2F%2Fwww%2Ehighscalability%2Ecom%2Fflickr-architecture&amp;urlhash=bWcl" target="_blank" title="New window will open">              http://www.highscalability.com/flickr-architecture</a></p>
<p>Additionally there is this presentation on <strong>scalable web architechure</strong>:</p>
<p><a href="http://www.slideshare.net/techdude/scalable-web-architectures-common-patterns-and-approaches">http://www.slideshare.net/techdude/scalable-web-architectures-common-patterns-and-approaches</a></p>
<span class="akst_link"><a href="http://grantusmaximus.com/web/?p=35&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_35"  class="akst_share_link">Share bookmark</a>
</span>]]></content:encoded>
			<wfw:commentRss>http://grantusmaximus.com/web/2008/02/08/image-storage-database-blob-vs-file-system/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Vistas first 2008 &#8216;reliability&#8217; update blue screens</title>
		<link>http://grantusmaximus.com/web/2008/01/11/vistas-first-2008-reliability-update-blue-screens/</link>
		<comments>http://grantusmaximus.com/web/2008/01/11/vistas-first-2008-reliability-update-blue-screens/#comments</comments>
		<pubDate>Fri, 11 Jan 2008 12:00:17 +0000</pubDate>
		<dc:creator>Grant Perry</dc:creator>
		
		<category><![CDATA[Operating systems]]></category>

		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://grantusmaximus.com/web/2008/01/11/vistas-first-2008-reliability-update-blue-screens/</guid>
		<description><![CDATA[As recommend by the Microsoft crew I had enabled automatic updates&#8230; Big mistake!
After my laptop installed the batch of updates released on the 9th of January my laptop began endlessly rebooting. It blue screens as soon as is starts to load Vista. To make things even better even safe mode does the same thing.
After a [...]]]></description>
			<content:encoded><![CDATA[<p>As recommend by the Microsoft crew I had enabled automatic updates&#8230; Big mistake!</p>
<p>After my laptop installed the batch of updates released on the 9th of January my laptop began endlessly rebooting. It blue screens as soon as is starts to load Vista. To make things even better even safe mode does the same thing.</p>
<p>After a process of trail and error with these update I worked out it was caused by <a href="http://support.microsoft.com/kb/943899">KB943899</a>.</p>
<p>Now obviously this doesn&#8217;t affect everyone otherwise they wouldn&#8217;t have release it&#8230; Or would they? Upon search the Internet I found a number of other reports from users with the same problem&#8230; I&#8217;ve only noticed DELL owners so far - I own a DELL XPS M1330.</p>
<p>I&#8217;ve raised a request with DELL as you can&#8217;t directly with Microsoft with an OEM license it appears&#8230; now we play the waiting game!</p>
<span class="akst_link"><a href="http://grantusmaximus.com/web/?p=34&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_34"  class="akst_share_link">Share bookmark</a>
</span>]]></content:encoded>
			<wfw:commentRss>http://grantusmaximus.com/web/2008/01/11/vistas-first-2008-reliability-update-blue-screens/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Zend debugger - without Zend Core/Zend Platform</title>
		<link>http://grantusmaximus.com/web/2007/12/16/zend-debugger-without-zend-corezend-platform/</link>
		<comments>http://grantusmaximus.com/web/2007/12/16/zend-debugger-without-zend-corezend-platform/#comments</comments>
		<pubDate>Sat, 15 Dec 2007 14:10:12 +0000</pubDate>
		<dc:creator>Grant Perry</dc:creator>
		
		<category><![CDATA[Apache]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Zend Core]]></category>

		<guid isPermaLink="false">http://grantusmaximus.com/web/2007/12/16/zend-debugger-without-zend-corezend-platform/</guid>
		<description><![CDATA[Zend debugger is basically the server side component that is used by Zend Studio. You need this to do your remote debugging!!
Normally you&#8217;d find this included in an installation of Zend Core or Zend Platform. However we aren&#8217;t using Zend&#8217;s apache php bundle so this little gem has to be loaded&#8230;
It&#8217;s hard to find on [...]]]></description>
			<content:encoded><![CDATA[<p>Zend debugger is basically the server side component that is used by Zend Studio. You need this to do your remote debugging!!</p>
<p>Normally you&#8217;d find this included in an installation of Zend Core or Zend Platform. However we aren&#8217;t using Zend&#8217;s apache php bundle so this little gem has to be loaded&#8230;</p>
<p>It&#8217;s hard to find on the net and not well advertised - I imagine because of Zend&#8217;s preference that you&#8217;d start using Zend Core.. Which looks great mind you but is missing some vital extensions some of our projects are using..</p>
<p><a href="http://downloads.zend.com/pdt/server-debugger/">http://downloads.zend.com/pdt/server-debugger/</a></p>
<span class="akst_link"><a href="http://grantusmaximus.com/web/?p=33&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_33"  class="akst_share_link">Share bookmark</a>
</span>]]></content:encoded>
			<wfw:commentRss>http://grantusmaximus.com/web/2007/12/16/zend-debugger-without-zend-corezend-platform/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Virtualisation: Host only and Internet networking</title>
		<link>http://grantusmaximus.com/web/2007/11/01/virtualisation-host-only-and-internet-networking/</link>
		<comments>http://grantusmaximus.com/web/2007/11/01/virtualisation-host-only-and-internet-networking/#comments</comments>
		<pubDate>Thu, 01 Nov 2007 12:10:57 +0000</pubDate>
		<dc:creator>Grant Perry</dc:creator>
		
		<category><![CDATA[Operating systems]]></category>

		<category><![CDATA[Parallels]]></category>

		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://grantusmaximus.com/web/2007/11/01/virtualisation-host-only-and-internet-networking/</guid>
		<description><![CDATA[I&#8217;m running a development server virtual machine on my Vista laptop using Parallels. Trouble is being on a laptop sometimes I&#8217;m on the road so a Host only network suits me, but other times I&#8217;m at home so I want the guest machine to connect to my home network. Up until now there has been [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m running a development server virtual machine on my Vista laptop using Parallels. Trouble is being on a laptop sometimes I&#8217;m on the road so a <em>Host only</em> network suits me, but other times I&#8217;m at home so I want the guest machine to connect to my home network. Up until now there has been A LOT of screwing around each time I leave and come just change network the network settings&#8230;</p>
<p>First of all I  tried the obvious Internet Connection Sharing throws some &#8220;(null)&#8221; error - Google forums to read about it. Bridged networking not that I really understand how this would have helped? this but someone made mention of it&#8230; I don&#8217;t profess to being a professional at this, BUT the following configuration made my life a dream.</p>
<p>Now I just simply change my the Network in Parallels from &#8220;Host only networking&#8221; to &#8220;Default adapter&#8221;..</p>
<p><strong>Router</strong></p>
<ul>
<li>IP -  10.0.1.1</li>
<li>Subnet - 255.255.0.0</li>
</ul>
<p><strong>Guest</strong></p>
<ul>
<li>IP: 10.0.2.10</li>
<li>Subnet - 255.255.0.0</li>
<li>Gateway: 10.0.1.1</li>
<li>DNS: 10.0.1.1</li>
</ul>
<p><strong>Host</strong></p>
<p>Parrallels Host-Guest NIC:</p>
<ul>
<li>IP: 10.0.2.20</li>
<li>Subnet - 255.255.255.0</li>
</ul>
<p>Default adapter NIC:</p>
<ul>
<li>IP: 10.0.1.20</li>
<li>Subnet - 255.255.0.0</li>
<li>Gateway: 10.0.1.1</li>
<li>DNS: 10.0.1.1</li>
</ul>
<p>If anyone cares to provide more insight, or has a better solution - would love to here from you! PS. All ip addresses have been changed to protect the innocent <img src='http://www.grantusmaximus.com/web/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p>
<span class="akst_link"><a href="http://grantusmaximus.com/web/?p=32&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_32"  class="akst_share_link">Share bookmark</a>
</span>]]></content:encoded>
			<wfw:commentRss>http://grantusmaximus.com/web/2007/11/01/virtualisation-host-only-and-internet-networking/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Giving PHP exec() some privilege</title>
		<link>http://grantusmaximus.com/web/2007/10/23/giving-php-exec-some-privilege/</link>
		<comments>http://grantusmaximus.com/web/2007/10/23/giving-php-exec-some-privilege/#comments</comments>
		<pubDate>Tue, 23 Oct 2007 13:49:17 +0000</pubDate>
		<dc:creator>Grant Perry</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://grantusmaximus.com/web/2007/10/23/giving-php-exec-some-privilege/</guid>
		<description><![CDATA[My problem is I and working on a web interface which runs some limit shell command. Some of these normally require root access&#8230; And I don&#8217;t want to do something silly like force apache to run as root now do I?
Provided you have sudo installed (like most distro&#8217;s) the following is a good solution I [...]]]></description>
			<content:encoded><![CDATA[<p>My problem is I and working on a web interface which runs some limit shell command. Some of these normally require root access&#8230; And I don&#8217;t want to do something silly like force apache to run as root now do I?</p>
<p>Provided you have sudo installed (like most distro&#8217;s) the following is a good solution I came across!</p>
<p>Update your sudoer config (mines at /etc/sudoers) so your apache user can run the required command.For example:</p>

<div class="wp_syntax"><div class="code"><pre class="dos">Cmnd_Alias TOOLS=/usr/sbin/yourcommand,/usr/sbin/anotherone
www-data ALL=NOPASSWD: TOOLS</pre></div></div>

<p>Then in your PHP you would execute the command like so:</p>

<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #990000;">exec</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/usr/bin/sudo /usr/sbin/yourcommand&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>If anyone can suggest a better method I&#8217;d love to hear!!</p>
<span class="akst_link"><a href="http://grantusmaximus.com/web/?p=31&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_31"  class="akst_share_link">Share bookmark</a>
</span>]]></content:encoded>
			<wfw:commentRss>http://grantusmaximus.com/web/2007/10/23/giving-php-exec-some-privilege/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP: Parse HTML returning links</title>
		<link>http://grantusmaximus.com/web/2007/10/10/php-parse-html-returning-links/</link>
		<comments>http://grantusmaximus.com/web/2007/10/10/php-parse-html-returning-links/#comments</comments>
		<pubDate>Tue, 09 Oct 2007 14:49:27 +0000</pubDate>
		<dc:creator>Grant Perry</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://grantusmaximus.com/web/2007/10/10/php-parse-html-returning-links/</guid>
		<description><![CDATA[My goal was more complex than what&#8217;s described here in, but I wanted  to share a simple function for returning the links in some HTML (now that I know  what I&#8217;m doing)&#8230; Hopefully someone finds this useful, it was a common question  in forums I noticed.
Regular expressions are a power tool for [...]]]></description>
			<content:encoded><![CDATA[<p>My goal was more complex than what&#8217;s described here in, but I wanted  to share a simple function for returning the links in some HTML (now that I know  what I&#8217;m doing)&#8230; Hopefully someone finds this useful, it was a common question  in forums I noticed.</p>
<p>Regular expressions are a power tool for working with strings. PHP provides  support for a couple of different types but I&#8217;m using preg (aka the Perl  compatible one).</p>
<p>The regular expression I put together for this was:</p>
<p><strong>/&lt;a\s[^&gt;]*href=&#8221;(?P&lt;href&gt;[^"]*)&#8221;\s[^&gt;]*&gt;(?P&lt;name&gt;.*)&lt;\/a&gt;/si</strong></p>
<p>What this means is:</p>
<ul>
<li><strong>/ </strong>- perl regular expression patterns are enclosed in forward slashes (this  is the opening one)</li>
<li><strong>&lt;a </strong>- is satisfied literally  (the open of the html a tag)</li>
<li><strong>\s </strong>- is a single whitespace character (includes line breaks etc)</li>
<li><strong>[^&gt;]*</strong> - satisfied by any characters except &gt;, this can be satisfied  zero - many times (allows for anything else inside the html a tag)
<ul>
<li><strong> [ ] </strong>- a charter class</li>
<li><strong>^</strong> - except the following</li>
<li><strong>&gt;</strong> - is satisfied literally</li>
<li><strong>*</strong> - the charter class can occur zero of many times</li>
</ul>
</li>
<li><strong>href=&#8221;</strong> - is satisfied literally</li>
<li><strong>(?P&lt;href&gt;[^"]*)</strong> - match and return as &#8216;href&#8217; - any characters except  &#8220;, this can be satisfied zero - many times (gets everything inside the href  attribute)
<ul>
<li><strong>( ) </strong>- match and return</li>
<li><strong>?P&lt;href&gt;</strong> - nominate the name we&#8217;ll return it as &#8216;href&#8217; could be  anything you like!</li>
<li><strong>[^"]* </strong>- satisfied by any characters except &#8220;, this can be satisfied zero -  many times</li>
</ul>
</li>
<li><strong>&gt;</strong> - is satisfied literally (the close of the html a tag)</li>
<li><strong>(?P&lt;name&gt;.*) </strong>- match and return as name - any character, this can be satisfied zero - many times (gets everything inside the a tag)
<ul>
<li><strong>( ) </strong>- match and return</li>
</ul>
<ul>
<li><strong>?P&lt;name&gt;</strong> - nominate the name we&#8217;ll return it as &#8216;name&#8217;.</li>
<li><strong>.*</strong> - satisfied by any character, this can be satisfied zero - many times</li>
</ul>
</li>
<li><strong>&lt;\/a&gt; </strong>- is satisfied literally (but we&#8217;re escaping the forward slash we don&#8217;t want to end up pattern here)</li>
<li><strong>/ </strong>- now we want to end our pattern!</li>
<li><strong>si </strong>- the trailing s and i are modifiers to change the way the expression is  interpreted
<ul>
<li><strong>s </strong>- means the . we&#8217;ve used can also represent line breaks (normally it doesn&#8217;t)</li>
<li><strong>i</strong> - means the entire thing is case insensitive!</li>
</ul>
</li>
</ul>
<p>A PHP function using this might look like so:</p>

<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> getLinks<span style="color: #009900;">&#40;</span><span style="color: #000033;">$responseBody</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>       
    <span style="color: #000033;">$_regexp</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'/&lt;a<span style="color: #000099; font-weight: bold;">\s</span>[^&gt;]*href=&quot;(?P&lt;href&gt;[^&quot;]*)&quot;<span style="color: #000099; font-weight: bold;">\s</span>[^&gt;]*&gt;(?P&lt;name&gt;.*)&lt;<span style="color: #000099; font-weight: bold;">\/</span>a&gt;/si'</span><span style="color: #339933;">;</span>
    <span style="color: #990000;">preg_match_all</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$_regexp</span><span style="color: #339933;">,</span> <span style="color: #000033;">$responseBody</span><span style="color: #339933;">,</span> <span style="color: #000033;">$matches</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000033;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$matches</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span> <span style="color: #b1b100;">as</span> <span style="color: #000033;">$name</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000033;">$links</span><span style="color: #009900;">&#91;</span><span style="color: #000033;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000033;">$i</span><span style="color: #339933;">++;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000033;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$matches</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'href'</span><span style="color: #009900;">&#93;</span> <span style="color: #b1b100;">as</span> <span style="color: #000033;">$href</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000033;">$links</span><span style="color: #009900;">&#91;</span><span style="color: #000033;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'href'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000033;">$href</span><span style="color: #339933;">;</span>
        <span style="color: #000033;">$i</span><span style="color: #339933;">++;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">return</span> <span style="color: #000033;">$links</span><span style="color: #339933;">;</span>   
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Issues with this regular expression I know I haven&#8217;t address are:</p>
<ul>
<li>You&#8217;re link may not be text, it could be an image or anything!</li>
<li>Not everyone using double quotes for their attributes.</li>
<li>Browsers support sloppy HTML this experession doesn&#8217;t! E.g. &lt;a href = /link/&gt;</li>
</ul>
<p>Any corrections or feedback would be pleased to hear from you!</p>
<span class="akst_link"><a href="http://grantusmaximus.com/web/?p=30&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_30"  class="akst_share_link">Share bookmark</a>
</span>]]></content:encoded>
			<wfw:commentRss>http://grantusmaximus.com/web/2007/10/10/php-parse-html-returning-links/feed/</wfw:commentRss>
		</item>
		<item>
		<title>cintraAD: Adding SVN and Trac users</title>
		<link>http://grantusmaximus.com/web/2007/09/20/cintraad-adding-svn-and-trac-users/</link>
		<comments>http://grantusmaximus.com/web/2007/09/20/cintraad-adding-svn-and-trac-users/#comments</comments>
		<pubDate>Thu, 20 Sep 2007 13:56:36 +0000</pubDate>
		<dc:creator>Grant Perry</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[cintraAD]]></category>

		<guid isPermaLink="false">http://grantusmaximus.com/web/2007/09/20/cintraad-adding-svn-and-trac-users/</guid>
		<description><![CDATA[Adding additional Trac and SVN users is relatively simple. With Trac you can do this under Admin when logged in as an administrator thanks to the WebAdmin and AccountManagerPlugins! For adding a new subversion user just use this command:

htpasswd /etc/apache2/dav_svn.passwd john_smith

This user will then have access to all of your subversion repositories because of the [...]]]></description>
			<content:encoded><![CDATA[<p>Adding additional Trac and SVN users is relatively simple. With Trac you can do this under Admin when logged in as an administrator thanks to the WebAdmin and AccountManagerPlugins! For adding a new subversion user just use this command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash">htpasswd <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>dav_svn.<span style="color: #c20cb9; font-weight: bold;">passwd</span> john_smith</pre></div></div>

<p>This user will then have access to all of your subversion repositories because of the way this server has been setup.</p>
<span class="akst_link"><a href="http://grantusmaximus.com/web/?p=29&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_29"  class="akst_share_link">Share bookmark</a>
</span>]]></content:encoded>
			<wfw:commentRss>http://grantusmaximus.com/web/2007/09/20/cintraad-adding-svn-and-trac-users/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
