<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Adam Jimenez</title><link href="http://www.adamjimenez.com/"/><entry><title>Faster Websites</title><summary type="html">&lt;p&gt;Following on from &lt;a href="http://www.adamjimenez.com/blog/web-development/faster-ajax-libraries"&gt;last week&lt;/a&gt; I've been working on more ways to make websites faster and save precious bandwidth.&lt;/p&gt; &#xD;
  &lt;h2&gt;gzip&lt;/h2&gt; &#xD;
  &lt;p&gt;I've enabled gzip compression in apache. I've set it to compress text based files like Javascript, CSS and HTML. There is a trade-off between cpu and bandwidth, but so far it seems worth it. Most files compress to around 30% of their original size. It is not worth the server load to compress images as jpegs/ gifs and pngs are already a compressed format.&lt;/p&gt; &#xD;
  &lt;p&gt; I've also enabled gzip compression in PHP. Because of &lt;a href="http://lib.shiftcreate.com"&gt;shiftlib&lt;/a&gt; this was easy to add to multiple sites at the same time.&lt;/p&gt; &#xD;
  &lt;p&gt;[php]&amp;lt;? ob_start(&amp;quot;ob_gzhandler&amp;quot;);&amp;nbsp; ?&amp;gt;[/php]&lt;/p&gt; &#xD;
  &lt;p&gt;To enable gzip in apache you need to do the following:&lt;br /&gt;&lt;/p&gt; &#xD;
  &lt;p&gt;# nano /etc/httpd/conf.d/mod_deflate.conf&#xD;
&lt;/p&gt; &#xD;
  &lt;blockquote&gt; &#xD;
    &lt;p&gt;  &amp;lt;IfModule mod_deflate.c&amp;gt;&lt;br /&gt;Insert filter&lt;br /&gt;SetOutputFilter DEFLATE&lt;/p&gt; &#xD;
    &lt;p&gt;    # Netscape 4.x has some problems    &lt;br /&gt;BrowserMatch ^Mozilla/4 gzip-only-text/html&lt;/p&gt; &#xD;
    &lt;p&gt;    # Netscape 4.06-4.08 have some more problems&lt;br /&gt;BrowserMatch ^Mozilla/4\.0[678] no-gzip&lt;/p&gt; &#xD;
    &lt;p&gt;    # MSIE masquerades as Netscape, but it is fine&lt;br /&gt;BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html&lt;/p&gt; &#xD;
    &lt;p&gt;    # Don't compress images&lt;br /&gt;SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary&lt;/p&gt; &#xD;
    &lt;p&gt;    # or pdfs&lt;br /&gt;SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary&lt;/p&gt; &#xD;
    &lt;p&gt;    # or binary archives&lt;br /&gt;SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar|iso|dia)$ no-gzip dont-vary &lt;/p&gt; &#xD;
    &lt;p&gt;    # Make sure proxies don't deliver the wrong content&lt;br /&gt;Header append Vary User-Agent env=!dont-vary&lt;/p&gt; &#xD;
    &lt;p&gt;    &amp;lt;IfModule mod_headers.c&amp;gt;&lt;br /&gt;#properly handle requests coming from behind proxies&lt;br /&gt;Header append Vary User-Agent env=!dont-vary&lt;br /&gt;&amp;lt;/IfModule&amp;gt;&lt;/p&gt; &#xD;
    &lt;p&gt;  &amp;lt;/IfModule&amp;gt;&lt;/p&gt; &#xD;
  &lt;/blockquote&gt; &#xD;
  &lt;p&gt;Then restart apache:&lt;/p&gt; &#xD;
  &lt;blockquote&gt; &#xD;
    &lt;p&gt;#service apached restart&lt;br /&gt;&lt;/p&gt; &#xD;
  &lt;/blockquote&gt; &#xD;
  &lt;p&gt; &lt;/p&gt; &#xD;
  &lt;p&gt; &lt;/p&gt; &#xD;
  &lt;h2&gt;Expiration headers&lt;/h2&gt; &#xD;
  &lt;p&gt;I've set apache to send 30 day cache headers with images/ css/ and javascript. This should mean that these files are cached on the users browser so that they don't have to download them on every single page load. This could result in a significant saving in bandwidth as images especially account for a big proportion for a web page.&lt;/p&gt; &#xD;
  &lt;p&gt;To enable expiration headers in apache - you need to do the following: &lt;br /&gt;&lt;/p&gt; &#xD;
  &lt;p&gt; &lt;/p&gt; &#xD;
  &lt;p&gt;#nano /etc/httpd/conf.d/mod_expires.conf&#xD;
&lt;/p&gt; &#xD;
  &lt;p&gt; &lt;/p&gt; &#xD;
  &lt;blockquote&gt; &#xD;
    &lt;p&gt;&amp;lt;&lt;span class="wikiword"&gt;IfModule&lt;/span&gt; mod_expires.c&amp;gt;&lt;br /&gt;&lt;span class="wikiword"&gt;ExpiresActive&lt;/span&gt; on&lt;br /&gt;&lt;span class="wikiword"&gt;ExpiresByType&lt;/span&gt; image/jpg &amp;quot;access 1 month&amp;quot;&lt;br /&gt;&lt;span class="wikiword"&gt;ExpiresByType&lt;/span&gt; image/gif &amp;quot;access 1 month&amp;quot;&lt;br /&gt;&lt;span class="wikiword"&gt;ExpiresByType&lt;/span&gt; image/png &amp;quot;access 1 month&amp;quot;&lt;br /&gt;&lt;span class="wikiword"&gt;ExpiresByType&lt;/span&gt; application/x-shockwave-flash &amp;quot;access 1 month&amp;quot;&lt;br /&gt;&lt;span class="wikiword"&gt;ExpiresByType&lt;/span&gt; text/html &amp;quot;access 1 day&amp;quot;&lt;br /&gt;&lt;span class="wikiword"&gt;ExpiresDefault&lt;/span&gt; &amp;quot;access 2 days&amp;quot;&lt;br /&gt;&amp;lt;/&lt;span class="wikiword"&gt;IfModule&lt;/span&gt;&amp;gt;&lt;/p&gt; &#xD;
  &lt;/blockquote&gt; &#xD;
  &lt;p&gt; Then restart apache:&lt;/p&gt; &#xD;
  &lt;blockquote&gt; &#xD;
    &lt;p&gt;#service apached restart&lt;/p&gt; &#xD;
  &lt;/blockquote&gt; &#xD;
  &lt;blockquote&gt; &lt;/blockquote&gt; &#xD;
  &lt;h2&gt;Caching thumbnails&lt;/h2&gt; &#xD;
  &lt;p&gt;Up until now my main PHP thumbnail script has generated images on the fly. PHP is so fast that it doesn't take very long even for a page full of images. However when you have lots of visitors all those clock cycles add up and there are significant savings to be made. My thumbnail script works by pointing the image source to a php script - and passing in the filename as a variable, e.g&lt;br /&gt;&lt;/p&gt; &#xD;
  &lt;p&gt; [php]&amp;lt;img src=&amp;quot;thumb.php?f=example.jpg&amp;quot;&amp;gt;[/php]&lt;/p&gt; &#xD;
  &lt;p&gt;There is a big problem with this. Because it's pointing to a php script the cache headers won't work. You could use the php header function to send the correct cache headers but I still suspect that it won't cache as well as a regular image. There is another problem - search engines won't know that it's an image - especially if it's in a link. They would just think it's a regular php page. So they will go ahead and pull down a bunch of images without needing to.&lt;br /&gt;&lt;/p&gt; &#xD;
  &lt;p&gt;So my new approach is a little different. I have a function that checks if there is a cached thumbnail before creating one if necessary. It then returns the image tag of the resulting thumnail. e.g.&lt;br /&gt;&lt;/p&gt; &#xD;
  &lt;p&gt;[php]&amp;lt;? image('example.jpg'); ?&amp;gt;[/php]&lt;/p&gt; &#xD;
  &lt;p&gt;outputs: &lt;/p&gt; &#xD;
  &lt;p&gt;[php]&amp;lt;img src=&amp;quot;uploads/cache/example.jpg&amp;quot;&amp;gt;[/php]&lt;/p&gt; &#xD;
  &lt;h2&gt;Search engines&lt;/h2&gt; &#xD;
  &lt;p&gt;I checked the web-stats of some of the busier websites that I host. There was a significant chunk of bandwidth being used by search engines - around 10%. Search engines will index an entire site several times over a month - but they shouldn't have to pull down every single image. This may be related to the thumbnail issue outlined above but I also have taken another precaution. I've created a robots.txt file and am now preventing access to uploads folders and thumbnail scripts and anything else that a search engine doesn't need. I may need to add an exception for google image search, but for the time being I will monitor it and see how it goes.&lt;br /&gt;&lt;/p&gt;</summary><link href="http://www.adamjimenez.com/blog/web-development/faster-websites"/></entry><entry><title>Faster AJAX Libraries</title><summary type="html">&lt;p&gt;Server bandwidth has been a tad high recently - so I decided to &#xD;
profile some of the busiest sites using the excellent resource measuring&#xD;
 tools in Google Chrome. The most obvious culprit on the sites I looked &#xD;
at was AJAX libraries like Prototype, jQuery and extJS. I needed to speed this up, now I already &#xD;
know about &lt;a target="_blank" href="http://code.google.com/apis/ajaxlibs/"&gt;Google AJAX libraries API&lt;/a&gt; - so that seemed like a good place to start.&lt;/p&gt; &#xD;
  &lt;p&gt;Google&#xD;
 AJAX libraries API provides an interface to load remote AJAX libraries &#xD;
using Google bandwidth. Google automatically handles caching and &#xD;
minifying to make the files load as quickly as possible. This is great &#xD;
but there are a few limitations.&lt;/p&gt; &#xD;
  &lt;p&gt;You have to declare which version&#xD;
 of the library to load. I manage a lot of sites and generally I just &#xD;
want the most efficient, up-to-date version without having to update &#xD;
many different websites.&lt;/p&gt; &#xD;
  &lt;p&gt;So I've added a PHP function to &lt;a target="_blank" href="http://lib.shiftcreate.com/"&gt;ShiftLib&lt;/a&gt; called load_js(). You can send this function an array of libraries and it will load the most up-to-date versions using Google AJAX Libraries.&lt;/p&gt; &#xD;
  &lt;p&gt;I've also added support for lightbox&#xD;
 and extJS - which are not supported by Google AJAX Libraries. My &#xD;
function will also detect if the page is running under SSL and subsequently load&#xD;
 all the scripts by HTTPS if it is. It loads all the scripts in the &#xD;
correct order to avoid conflicts and works out dependencies - e.g. &#xD;
lightbox requires prototype to work.&lt;/p&gt; &#xD;
  &lt;p&gt;So instead of having a block of code like this:&lt;/p&gt; &#xD;
  &lt;p&gt;[php]&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;/_lib/js/ext/resources/css/ext-all.css&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;/_lib/js/ext/adapter/ext/ext-base.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;/_lib/js/ext/ext-all.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;/_lib/js/prototype.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;/_lib/js/scriptaculous/scriptaculous.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;/scripts/jquery-1.3.2.min.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script&amp;gt;&lt;br /&gt;jQuery.noConflict();&lt;br /&gt;&amp;lt;/script&amp;gt;[/php]&lt;br /&gt; &lt;/p&gt; &#xD;
  &lt;p&gt;I now have:&lt;/p&gt; &#xD;
  &lt;p&gt;[php]&amp;lt;? load_js(array('extjs','scriptaculous','jquery')); ?&amp;gt;[/php]&#xD;
&lt;/p&gt; &#xD;
  &lt;p&gt;Much nicer.&lt;br /&gt; &lt;/p&gt;</summary><link href="http://www.adamjimenez.com/blog/web-development/faster-ajax-libraries"/></entry><entry><title>Tips for optimising MySQL queries</title><summary type="html">&lt;p&gt;Database queries can very often be the bottle-neck that slows down a webpage. If you have a busy server with lots of sites or lots of webpages it's not always apparent which database queries are causing the problems.&lt;/p&gt; &#xD;
  &lt;h2&gt;Logging slow queries &lt;br /&gt;&lt;/h2&gt; &#xD;
  &lt;p&gt;A good place to start is by logging slow queries. You can do this by adding the following lines to your MySQL config file (usually /etc/my.cnf)&lt;/p&gt; &#xD;
  &lt;blockquote&gt; &#xD;
    &lt;p&gt;&amp;nbsp;set-variable=long_query_time=1&lt;br /&gt;log_slow_queries = /var/log/mysql/mysql-slow.log&lt;/p&gt; &#xD;
  &lt;/blockquote&gt; &#xD;
  &lt;p&gt;&amp;nbsp;Create the log file and give it write access:&lt;/p&gt; &#xD;
  &lt;blockquote&gt; &#xD;
    &lt;p&gt; touch /var/log/mysql/mysql-slow.log&lt;br /&gt;chmod 777 /var/log/mysql/mysql-slow.log &lt;/p&gt; &#xD;
  &lt;/blockquote&gt; &#xD;
  &lt;p&gt; You will then need to restart mysql:&lt;/p&gt; &#xD;
  &lt;blockquote&gt; &#xD;
    &lt;p&gt;service mysqld restart&lt;/p&gt; &#xD;
  &lt;/blockquote&gt; &#xD;
  &lt;p&gt;After a while the log file should start to fill up with a list of queries that have taken longer than 1 second.&lt;br /&gt;Not all of these queries will be poorly optimised - it could be that some queries can't be further optimised or that they took a long time because the server was very busy. Even so it is a good indicator and you can look through the list of queries and start optimising them.&lt;/p&gt; &#xD;
  &lt;h2&gt;Indexes&lt;/h2&gt; &#xD;
  &lt;p&gt;Adding indexes can have a dramatic affect on speed. You should look at the table joins and WHERE conditions of the query to see where indexes could be used.&lt;/p&gt; &#xD;
  &lt;p&gt;Take these examples. &lt;br /&gt;&lt;/p&gt; &#xD;
  &lt;blockquote&gt; &#xD;
    &lt;p&gt;SELECT * FROM users WHERE name ='Joe'&lt;/p&gt; &#xD;
  &lt;/blockquote&gt; &#xD;
  &lt;p&gt;Adding an index to the &amp;quot;name&amp;quot; column will significantly improve this query.&lt;/p&gt;  &#xD;
  &lt;blockquote&gt; &#xD;
    &lt;p&gt;SELECT * FROM users WHERE name ='Joe' AND surname='Schmoe'&lt;/p&gt; &#xD;
  &lt;/blockquote&gt; &#xD;
  &lt;p&gt;Adding one combined index for &amp;quot;name&amp;quot; and &amp;quot;surname&amp;quot; will help here.&lt;/p&gt; &#xD;
  &lt;blockquote&gt; &#xD;
    &lt;p&gt;SELECT * FROM users WHERE email='joe.schmoe@gmail.com'&lt;/p&gt; &#xD;
  &lt;/blockquote&gt; &#xD;
  &lt;p&gt;In this case I would use a unique index for the email column. Unique means that the email address can only appear once in the table. This is much faster than a regular index and also enforces the database integrity.&lt;br /&gt;&lt;/p&gt; &#xD;
  &lt;p&gt;Note that indexes take up space and slow down insert/ updates - but this is generally a small price to pay for much faster select statements.&lt;br /&gt;&lt;/p&gt; &#xD;
  &lt;h2&gt;Correct field types&lt;/h2&gt; &#xD;
  &lt;p&gt;It's worth looking over the database structure and seeing if a TINYINT could be used instead of an INT. Or an ENUM instead of a VARCHAR. Also check the size of the VARCHAR columns and adjust accordingly. Check if INT fields should be UNSIGNED. An UNSIGNED INT can only be positive (&amp;gt;=0). Unsigned INTs should always be used for ID columns - and again this helps with your database integrity. You may need to run &amp;quot;OPTIMIZE table&amp;quot; before you see any benefit. You probably won't see a drastic improvement - but these little changes all add up.&lt;br /&gt;&lt;/p&gt; &#xD;
  &lt;h2&gt;Other tips&lt;br /&gt;&lt;/h2&gt; &#xD;
  &lt;p&gt;Joins are an expensive operation and should only be used when absolutely necessary. Check the fields you are selecting and your WHERE conditions to see if you really need each join.&lt;br /&gt;&lt;/p&gt; &#xD;
  &lt;p&gt;&amp;nbsp;Only select what you need to, so if you only need to fetch an ID instead of doing:&lt;/p&gt; &#xD;
  &lt;blockquote&gt; &#xD;
    &lt;p&gt; SELECT * FROM table WHERE name='Joe'&lt;br /&gt;&lt;/p&gt; &#xD;
  &lt;/blockquote&gt; &#xD;
  &lt;p&gt;do: &lt;br /&gt;&lt;/p&gt; &#xD;
  &lt;blockquote&gt; &#xD;
    &lt;p&gt;SELECT id FROM table WHERE name='Joe'&lt;/p&gt; &#xD;
  &lt;/blockquote&gt; &#xD;
  &lt;p&gt;&amp;nbsp;And you can use limit to prevent searching of the entire table.&lt;/p&gt; &#xD;
  &lt;blockquote&gt; &#xD;
    &lt;p&gt; SELECT id FROM table WHERE name='Joe' LIMIT 1&lt;/p&gt; &#xD;
  &lt;/blockquote&gt; &#xD;
  &lt;p&gt;Try not to include MySQL queries in PHP loops - you might be able to get the same outcome using a join or a sub-select at a fraction of the time.&lt;/p&gt; &#xD;
  &lt;p&gt;This should be enough to get you started. For even better performance you could try tweaking MySQL itself or upgrading your hardware.&lt;br /&gt;&lt;/p&gt;</summary><link href="http://www.adamjimenez.com/blog/web-development/tips-for-optimising-mysql-queries"/></entry><entry><title>The Best Open Source Games</title><summary type="html">&lt;p&gt;There are very few polished, highly enjoyable open source games. These are the best that I know about:&lt;/p&gt; &#xD;
  &lt;p&gt;&lt;a href="http://wz2100.net/"&gt;Warzone 2100&lt;/a&gt;&lt;/p&gt; &#xD;
  &lt;p&gt;A futuristic RTS game. Originally a commercial game was made open source in 2004. Since then the developers have been regularly updating and improving the game . Very under-rated game at the time. Has some innovative ideas like designing your own units . Is a blast when playing multiplayer over a network &lt;/p&gt; &#xD;
  &lt;p&gt;&lt;object width="480" height="385"&gt;&lt;param name="movie" value="http://www.youtube.com/v/gTL17BeadEI&amp;amp;hl=en_GB&amp;amp;fs=1&amp;amp;" /&gt;&lt;param name="allowFullScreen" value="true" /&gt;&lt;param name="allowscriptaccess" value="always" /&gt;&lt;embed width="480" height="385" src="http://www.youtube.com/v/gTL17BeadEI&amp;amp;hl=en_GB&amp;amp;fs=1&amp;amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;&lt;/p&gt; &#xD;
  &lt;p&gt;&lt;br /&gt;&lt;a href="http://bombermaaan.sourceforge.net/"&gt;Bombermaaan&lt;/a&gt;&lt;/p&gt; &#xD;
  &lt;p&gt;Faithful remake of the classic SNES Bomberman. The game is fast, slick and is one of the best 4-player games you can play. &lt;/p&gt; &#xD;
  &lt;p&gt;&lt;object width="480" height="385"&gt;&lt;param value="http://www.youtube.com/v/SgVdsrDAUwA&amp;amp;hl=en_GB&amp;amp;fs=1&amp;amp;" name="movie" /&gt;&lt;param value="true" name="allowFullScreen" /&gt;&lt;param value="always" name="allowscriptaccess" /&gt;&lt;embed width="480" height="385" allowfullscreen="true" allowscriptaccess="always" type="application/x-shockwave-flash" src="http://www.youtube.com/v/SgVdsrDAUwA&amp;amp;hl=en_GB&amp;amp;fs=1&amp;amp;" /&gt;&lt;/object&gt;&lt;br /&gt;&lt;/p&gt; &#xD;
  &lt;p&gt;&lt;a href="http://chaosgroove.shiftcreate.com/"&gt;&lt;br /&gt;Chaos Groove&lt;/a&gt;&lt;/p&gt; &#xD;
  &lt;p&gt;Remake of the spectrum classic Chaos: Battle of the Wizards. It's a turn-based strategy game - very tactical, and very fun in multiplayer.&lt;br /&gt;&lt;/p&gt; &#xD;
  &lt;p&gt;&lt;br /&gt;&lt;a href="http://ultrastardx.sourceforge.net/"&gt;Ultrastar Deluxe&lt;/a&gt;&lt;/p&gt; &#xD;
  &lt;p&gt; Get yourself a pair of &lt;a href="http://www.play.com/Games/PlayStation3/4-/7946002/SingStar-Wired-Microphones-for-PS3-PS2/Product.html?_$ja=tsid:11518%7Ccc:%7Cprd:7946002%7Ccat:Hardware"&gt;singstar mics&lt;/a&gt; and croon away to your hearts delight and find out how terrible you are. Very fun game that anyone can have a go at.&lt;/p&gt; &#xD;
  &lt;p&gt;&lt;object width="480" height="385"&gt;&lt;param name="movie" value="http://www.youtube.com/v/uvBSeme34bE&amp;amp;hl=en_GB&amp;amp;fs=1&amp;amp;" /&gt;&lt;param name="allowFullScreen" value="true" /&gt;&lt;param name="allowscriptaccess" value="always" /&gt;&lt;embed width="480" height="385" src="http://www.youtube.com/v/uvBSeme34bE&amp;amp;hl=en_GB&amp;amp;fs=1&amp;amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;&lt;/p&gt; &#xD;
  &lt;p&gt;&lt;br /&gt;&lt;a href="http://fretsonfire.sourceforge.net/"&gt;Frets on Fire&lt;/a&gt;&lt;/p&gt; &#xD;
  &lt;p&gt;Guitar Hero for PC, feels surprisingly natural with the keyboard controls. Very good game with plenty of tracks available on the interweb. &lt;/p&gt; &#xD;
  &lt;p&gt;&lt;object width="480" height="385"&gt;&lt;param name="movie" value="http://www.youtube.com/v/Vs-2p7x6YA4&amp;amp;hl=en_GB&amp;amp;fs=1&amp;amp;" /&gt;&lt;param name="allowFullScreen" value="true" /&gt;&lt;param name="allowscriptaccess" value="always" /&gt;&lt;embed width="480" height="385" src="http://www.youtube.com/v/Vs-2p7x6YA4&amp;amp;hl=en_GB&amp;amp;fs=1&amp;amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;&lt;/p&gt; &#xD;
  &lt;p&gt;&lt;br /&gt;&lt;a href="http://www.armagetronad.net/"&gt;Armagetron&lt;/a&gt;&lt;/p&gt; &#xD;
  &lt;p&gt;Tron like game. Good multiplayer. Simple to play - lightning reflexes are required. &lt;/p&gt; &#xD;
  &lt;p&gt;&lt;object width="480" height="385"&gt;&lt;param value="http://www.youtube.com/v/wKnTOYxtMeg&amp;amp;&amp;lt;span id=" /&gt;&lt;param value="true" name="allowFullScreen" /&gt;&lt;param value="always" name="allowscriptaccess" /&gt;&lt;embed width="480" height="385" allowfullscreen="true" allowscriptaccess="always" type="application/x-shockwave-flash" src="http://www.youtube.com/v/wKnTOYxtMeg&amp;amp;hl=en_GB&amp;amp;fs=1&amp;amp;" /&gt;&lt;/object&gt;&lt;br /&gt;&lt;/p&gt; &#xD;
  &lt;p&gt;&lt;br /&gt;&lt;a href="http://www.pokerth.net/"&gt;PokerTH&lt;/a&gt;&lt;/p&gt; &#xD;
  &lt;p&gt;very good interpretation of the ever-popular card game.great to practice on without losing money. &lt;/p&gt; &#xD;
  &lt;p&gt;&lt;object width="480" height="385"&gt;&lt;param value="http://www.youtube.com/v/nSM4C-0HgIc&amp;amp;&amp;lt;span id=" /&gt;&lt;param name="allowFullScreen" value="true" /&gt;&lt;param name="allowscriptaccess" value="always" /&gt;&lt;embed width="480" height="385" src="http://www.youtube.com/v/nSM4C-0HgIc&amp;amp;hl=en_GB&amp;amp;fs=1&amp;amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;&lt;/p&gt; &#xD;
  &lt;p&gt; &lt;a href="http://wildfiregames.com/0ad/"&gt;0AD&lt;/a&gt;&lt;/p&gt; &#xD;
  &lt;p&gt;special mention to what looks like is going to be a fantastic RTS game in the mould of Age of Empires.&amp;nbsp; &lt;/p&gt; &#xD;
  &lt;p&gt;&lt;object width="480" height="385"&gt;&lt;param value="http://www.youtube.com/v/hJG8SHH39W4&amp;amp;hl=en_GB&amp;amp;fs=1&amp;amp;" name="movie" /&gt;&lt;param value="true" name="allowFullScreen" /&gt;&lt;param value="always" name="allowscriptaccess" /&gt;&lt;embed width="480" height="385" allowfullscreen="true" allowscriptaccess="always" type="application/x-shockwave-flash" src="http://www.youtube.com/v/hJG8SHH39W4&amp;amp;hl=en_GB&amp;amp;fs=1&amp;amp;" /&gt;&lt;/object&gt;&lt;br /&gt;&lt;/p&gt;</summary><link href="http://www.adamjimenez.com/blog/games/best-open-source-games"/></entry><entry><title>Synchronising Facebook, Twitter and Google Buzz</title><summary type="html">&lt;p&gt;Social networks are great; they allow you to show everyone who cares what you're doing and thinking.&lt;img align="right" src="http://www.adamjimenez.com/uploads/daisychainingsocialnetworks.png" /&gt;&lt;/p&gt; &#xD;
  &lt;p&gt;But what social network do you choose? &lt;a href="http://www.facebook.com"&gt;Facebook&lt;/a&gt; and &lt;a href="http://www.twitter.com"&gt;Twitter&lt;/a&gt; are very popular and &lt;a href="http://www.google.com/buzz"&gt;Google Buzz&lt;/a&gt; is new - and built right into GMail.&lt;/p&gt; &#xD;
  &lt;p&gt;For me it's important to keep in contact with as many people as possible, whichever social network they are on. So I'm signed up to all three.&lt;/p&gt; &#xD;
  &lt;p&gt;I only have a limited amount of free time so I've needed a way to synchronise my status updates with all three. I tried some software like tweetdeck and some others - but they all felt a bit over-complicated and had horrible UIs. Plus I'd prefer not to have to install an app just to make a status update.&lt;/p&gt; &#xD;
  &lt;p&gt;Facebook and Google don't exactly see eye-to-eye. There doesn't appear to be a way to hook them up together.The answer to this problem comes from the most open network of them all. Yep the answer is twitter.&lt;/p&gt; &#xD;
  &lt;p&gt;With Twitter you can daisy-chain your networks together. Google Buzz allows you to connect your account to your twitter account. There is a &lt;a href="http://apps.facebook.com/twitter/"&gt;facebook twitter app&lt;/a&gt; that pulls in your tweets. &lt;/p&gt;&#xD;
  &lt;p&gt;So now anything I post on twitter will appear in Facebook and Google Buzz. But it doesn't have to stop there. Because twitter is so open you don't even have to use twitter directly. You can use other programs that post tweets such as &lt;a href="http://www.boxee.tv/"&gt;Boxee&lt;/a&gt;. And you can use the &lt;a href="http://apiwiki.twitter.com/"&gt;twitter apis&lt;/a&gt; to make your own software post tweets.&lt;br /&gt;&lt;/p&gt;</summary><link href="http://www.adamjimenez.com/blog/general/synchronising-facebook-twitter-and-google-buzz"/></entry><entry><title>PHP Namespaces and Closures</title><summary type="html">&lt;p&gt;PHP 5.3 comes with two very important features: Namespaces and &#xD;
Closures.&lt;/p&gt; &#xD;
  &lt;h2&gt;Namespaces&lt;/h2&gt; &#xD;
  &lt;p&gt;Namespaces allow you to compartmentalise your classes, constants &#xD;
and functions.&lt;/p&gt; &#xD;
  &lt;p&gt;This can prevent conflicts between your code and third-party code. &#xD;
Third-party code could be a blog or a forum that you've installed on &#xD;
your website. &lt;/p&gt; &#xD;
  &lt;p&gt;I had a conflict when adding wordpress to a website. Wordpress was &#xD;
complaining that the is_email function already existed. This is because &#xD;
is_email is a function in my library that I use all the time to &#xD;
determine if an email address is valid. My only choice was to either &#xD;
rename one of the functions - or get wordpress to use mine. Changing &#xD;
anything like that in wordpress is not feasible - as any changes I make &#xD;
would need to be redone every time wordpress is updated. So I ended up &#xD;
renaming my function to is_valid_email and then going through all my &#xD;
code and referring it to the new, less snappier function name. Not an &#xD;
ideal solution by any means. &lt;/p&gt; &#xD;
  &lt;p&gt;Namespaces would have been a much better solution as you can &#xD;
effectively say - this is my code and this is wordpress and put them in &#xD;
their own little namespace box so that they can't kill each-other.&lt;/p&gt; &#xD;
  &lt;h2&gt;Closures / Anonymous functions&lt;br /&gt;&lt;/h2&gt; &#xD;
  &lt;p&gt;For ages I didn't know what lexical closures meant - even though I &#xD;
use them all the time. Lexical closures is a complicated name for &#xD;
anonymous functions. Anonymous functions have been in javascript for a &#xD;
very long time.&lt;/p&gt; &#xD;
  &lt;p&gt; In javascript you would typically use an anonymous function on an &#xD;
event handler.&lt;br /&gt;Here's some prototype code using a standard function:&lt;br /&gt;&lt;/p&gt; [javascript]$('foo').observe('click', hello);&#xD;
&#xD;
function hello() {&#xD;
  alert('hello');&#xD;
} [/javascript]&#xD;
  &#xD;
  &#xD;
  &#xD;
  &#xD;
  &lt;p&gt;Here's the same code with an anonymous function:&lt;/p&gt; &#xD;
  &lt;p&gt;[javascript]$('foo').observe('click', function(){&lt;br /&gt;&amp;nbsp; &#xD;
alert('hello');&lt;br /&gt;});[/javascript]&lt;br /&gt;&lt;/p&gt; &#xD;
  &lt;p&gt;The hello function is only ever going to used as an event handler -&#xD;
 so we don't need to give it a name. This means that the code is more &#xD;
concise and we haven't had to spend time thinking of a good function &#xD;
name.&lt;/p&gt; &#xD;
  &lt;p&gt;This is an example of how they are implemented in PHP - taken from &#xD;
the PHP manual:&lt;/p&gt; &#xD;
  &lt;div class="example-contents programlisting"&gt; &#xD;
    [php]&amp;lt;?php&lt;br /&gt;echo &#xD;
preg_replace_callback('~-([a-z])~', function ($match) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &#xD;
strtoupper($match[1]);&lt;br /&gt;}, 'hello-world');&lt;br /&gt;// outputs helloWorld&lt;br /&gt;?&amp;gt;[/php]&#xD;
    &#xD;
      &#xD;
      &#xD;
    &#xD;
    &lt;p&gt;&lt;a target="_blank" href="http://uk3.php.net/namespaces"&gt;Namespaces&#xD;
 in the PHP manual&lt;/a&gt; &lt;br /&gt;&lt;a target="_blank" href="http://uk3.php.net/manual/en/functions.anonymous.php"&gt;Anonymous functions in the PHP manual &lt;/a&gt;&lt;br /&gt;&lt;/p&gt; &#xD;
  &lt;/div&gt;</summary><link href="http://www.adamjimenez.com/blog/web-development/php-namespaces-and-closures"/></entry><entry><title>PC games that support the 360 controller</title><summary type="html">&lt;p&gt;I'm a living room gamer whose platform of choice is the PC. I believe the 360 controller is the finest games controller ever constructed and is the controller of choice for PC gaming.&lt;/p&gt;&#xD;
  &lt;p&gt;Most new PC games support the 360 controller. A lot of older games and some new games don't support the controller out of the box - or even at all.&lt;/p&gt;&#xD;
  &lt;p&gt;Here are some games that support the xbox controller:&lt;/p&gt;&#xD;
  &lt;ul&gt;&#xD;
    &lt;li&gt;Batman Arkham Asylum&lt;/li&gt;&#xD;
    &lt;li&gt;Braid&lt;/li&gt;&#xD;
    &lt;li&gt;Crysis&lt;/li&gt;&#xD;
    &lt;li&gt;Gears of War&lt;/li&gt;&#xD;
    &lt;li&gt;Lost Planet: extreme condition&lt;/li&gt;&#xD;
    &lt;li&gt;Micro Machines V4&lt;br /&gt;&lt;/li&gt;&#xD;
    &lt;li&gt;Pro Evolution Soccer 2009&lt;/li&gt;&#xD;
    &lt;li&gt;Pro Evolution Soccer 2010&lt;/li&gt;&#xD;
    &lt;li&gt;Prototype&lt;/li&gt;&#xD;
    &lt;li&gt;Resident Evil 5&lt;/li&gt;&#xD;
    &lt;li&gt;Star Wars The Force Unleashed&lt;br /&gt;&lt;/li&gt;&#xD;
    &lt;li&gt;Tomb Raider Legend&lt;/li&gt;&#xD;
    &lt;li&gt;Tomb Raider Underworld&lt;/li&gt;&#xD;
    &lt;li&gt;TrackMania&lt;br /&gt;&lt;/li&gt;&#xD;
    &lt;li&gt;Trine&lt;br /&gt;&lt;/li&gt;&#xD;
    &lt;li&gt;Wolverine Unleashed&lt;/li&gt;&#xD;
  &lt;/ul&gt;And some more &lt;a href="http://www.giantbomb.com/pc-games-with-xbox-360-controller-support/92-2465/games/" target="_blank"&gt;games with 360 controller support&lt;/a&gt;.&lt;br /&gt;</summary><link href="http://www.adamjimenez.com/blog/games/pc-games-360-controller-support"/></entry><entry><title>Joe Danger</title><summary type="html">&lt;img width="209" height="289" align="right" src="http://www.adamjimenez.com/uploads/JOE_AND_LOGO-741x1024.png" /&gt;The &lt;a href="http://www.igf.com/02finalists.html" target="_blank"&gt;2010 Independent Games Festival Finalists&lt;/a&gt; have been announced. I had a look through the nominations for the coveted Seumas McNally Grand Prize. Previous winners include the excellent &lt;a href="http://www.crayonphysics.com/" target="_blank"&gt;Crayon Physics Deluxe&lt;/a&gt;. Independent games are made by small teams of independent developers. Because of this a lot of independent games can lack in areas like graphics, sound and presentation - especially when compared against commercial offerings. However they almost always have a great gameplay element to them. Unfortunately that isn't always enough for casual gamers who can't look past such obvious flaws.&amp;nbsp; So when an independent game does come along with great sound, graphics, presentation you have to sit up and take notice. From the &lt;a href="http://www.youtube.com/watch?v=PEME6Z74h4c" target="_blank"&gt;leaked gameplay footage&lt;/a&gt; I've seen - &lt;a href="http://www.joe-danger.com/"&gt;Joe Danger&lt;/a&gt; ticks all of these boxes. It's set for release in the spring for PC/ xbox/ PSN&amp;nbsp; and will support splitscreen multiplayer. I for one can not wait.</summary><link href="http://www.adamjimenez.com/blog/games/joe-danger"/></entry><entry><title>Knowing when to say no</title><summary type="html">&lt;p&gt;As a freelance developer sometimes it's tempting to take on every bit of work that comes along. But a short term gain now is not always in your long term interests.&lt;/p&gt; &#xD;
  &lt;p&gt;Some projects are not well thought out/ rely on existing code or have too many strings attached.&lt;/p&gt; &#xD;
  &lt;h2&gt;Not well thought out projects&lt;br /&gt;&lt;/h2&gt; &#xD;
  &lt;p&gt;Sometimes I'm asked to quote on building a site like website X. Or quote on a project after a 5 minute conversation.&lt;br /&gt;&lt;/p&gt; &#xD;
  &lt;p&gt;This is never enough to go on. At least you want some sort of written up project brief which you can turn into a workable spec which outlines all the pages and functionality therein. At best you might even be given a sitemap or detailed project plan. The more information the better, because once a quote is agreed there can't be any room for misinterpretation. Otherwise the project will drag on and on and become less and less profitable.&lt;/p&gt; &#xD;
  &lt;h2&gt;Projects that rely on existing code&lt;/h2&gt; &#xD;
  &lt;p&gt;You should take extra care when taking on a project that relies on existing code. If the project was done by a previous developer - make sure you have a good look over the code and see what condition it's in before you commit. Sometimes it's quicker and easier to redo a site than it is to work with badly written code. This will also help avoid any security issues with existing code and make the whole project a lot easier to maintain.&lt;/p&gt; &#xD;
  &lt;p&gt;The other type of projects with existing code are those that rely on drupal/ mambo etc or other off-the-shelf systems like shopping carts.&lt;/p&gt; &#xD;
  &lt;p&gt;In some ways these systems are worse. They are inflexible, require more hacking, often low-budget and a nightmare to maintain. I personally avoid them like the plague.&lt;/p&gt; &#xD;
  &lt;p&gt;The only exception I make to this are forums like phpBB which are self-contained and can be cordoned off from the rest of the website.&lt;/p&gt; &#xD;
  &lt;h2&gt;Too Many Strings Attached&lt;/h2&gt; &#xD;
  &lt;p&gt;Don't compromise on your policies without serious considerations. Don't back down over your payment terms and read contracts very carefully before agreeing to them. Make sure you reserve the right to re-use code that you've developed. And don't agree to any personal liabilities.&lt;/p&gt; &#xD;
  &lt;p&gt;That's it for now, feel free to leave a comment.&lt;br /&gt;&lt;/p&gt;</summary><link href="http://www.adamjimenez.com/blog/web-development/knowing-when-to-say-no"/></entry><entry><title>Separating PHP from HTML</title><summary type="html">&lt;p&gt;Very often PHP coders will output HTML like so:&lt;br /&gt;[php]&amp;lt;?php&lt;br /&gt;print '&amp;lt;ul&amp;gt;'; &lt;br /&gt;foreach( $links as $link=&amp;gt;$title ){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print '&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;'.$link.'&amp;quot;&amp;gt;'.$title.'&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;';&lt;br /&gt;}&lt;br /&gt;print '&amp;lt;/ul&amp;gt;';&lt;br /&gt;?&amp;gt;&lt;br /&gt;[/php]&lt;br /&gt;This causes the following issues:&lt;/p&gt; &#xD;
  &lt;p&gt;&lt;strong&gt;It's harder for web designers to work with&lt;/strong&gt;&lt;br /&gt;Tthe code won't display properly in dreamweaver design mode. And designers will need some knowledge of PHP and good knowledge of HTML to be able to edit it.&lt;/p&gt; &#xD;
  &lt;p&gt;&lt;strong&gt;It gets in the way of syntax highlighting&lt;/strong&gt;&lt;br /&gt; Syntax highlighters will just highlight the printed line as one big string. They will not be able to highlight the different tags and attributes. So the code is much harder to read.&lt;/p&gt; &#xD;
  &lt;p&gt;&lt;strong&gt;It gets in the way of code-assist&lt;/strong&gt;&lt;br /&gt;Code assist or intellisense won't be able to help you with your HTML because it will be treating the code as a string much like with syntax highlighting.&lt;br /&gt;&lt;/p&gt; &#xD;
  &lt;p&gt;&lt;strong&gt;You have to watch out for quotes.&lt;/strong&gt;&lt;br /&gt;Any singe quotes will need to be escaped like so \' . This can be time consuming if you are dealing with lots of text and it's also something that most web designers who are working with your code won't be aware of.&lt;/p&gt; &#xD;
  &lt;p&gt;So what's the answer. Well here's how I do it.&lt;/p&gt; &#xD;
  &lt;p&gt; [php]&amp;lt;ul&amp;gt;&lt;br /&gt;&amp;lt;?&lt;br /&gt;foreach( $links as $link=&amp;gt;$title ){&lt;br /&gt;?&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;&amp;lt;?=$link;?&amp;gt;&amp;quot;&amp;gt;&amp;lt;?=$title;?&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;&amp;lt;?&lt;br /&gt;}&lt;br /&gt;?&amp;gt;&lt;br /&gt;&amp;lt;/ul&amp;gt;[/php]&lt;br /&gt;This approach involves a few more PHP tags but it solves all of the above issues. It works better in IDEs, is easier to read and maintain and helps keep PHP and HTML separate. &lt;/p&gt; &#xD;
  &lt;p&gt;It is also recommended to use &lt;a href="http://www.webhostingsearch.com/php-web-hosting.php"&gt;PHP hosting&lt;/a&gt; for PHP sites and apps, since it has been optimized for PHP scripts.&lt;br /&gt;&lt;/p&gt;</summary><link href="http://www.adamjimenez.com/blog/web-development/separating-php-from-html"/></entry><entry><title>PHP/MySQL INSERT</title><summary type="html">&lt;p&gt;PHP is a very flexible language. Maybe too flexible. There are a lot of ways to skin a cat. Some ways are a lot better than others, and some have security vulnerabilites. &lt;/p&gt; &#xD;
  &lt;p&gt;After a day of monitoring web development forums it's quickly become apparent that beginners get very confused about MySQL. &lt;/p&gt;  &#xD;
  &lt;p&gt;In this post I will focus on inserting data into a database. There are a few different ways to insert data into a database. Imagine we are capturing some user data. This is how I would do it:&lt;/p&gt; &#xD;
  &lt;p&gt;[php]&amp;lt;?php&lt;br /&gt;mysql_query(&amp;quot;INSERT INTO `table` SET&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;date=NOW(),&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;name='&amp;quot;.escape($_POST['name']).&amp;quot;',&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;surname='&amp;quot;.escape($_POST['surname']).&amp;quot;',&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;email='&amp;quot;.escape($_POST['email']).&amp;quot;',&lt;br /&gt;&amp;quot;) or trigger_error(&amp;quot;SQL&amp;quot;, E_USER_ERROR);&lt;br /&gt;?&amp;gt;[/php]&lt;br /&gt;&lt;/p&gt; &#xD;
  &lt;p&gt;&amp;nbsp;Now there are a few things going on here:&lt;/p&gt; &#xD;
  &lt;ul&gt; &#xD;
    &lt;li&gt;the query is broken up onto multiple lines and indented for readability.&lt;/li&gt; &#xD;
    &lt;li&gt;sql syntax is in uppercase, again for readability&lt;/li&gt; &#xD;
    &lt;li&gt;using NOW()  instead of timestamps&lt;/li&gt; &#xD;
    &lt;li&gt;using a custom function called escape which is just a wrapper for mysql_real_escape_string; to save typing&lt;/li&gt; &#xD;
    &lt;li&gt;Using concatenation for readability.&lt;/li&gt; &#xD;
    &lt;li&gt;custom error handler - which in my case sends me an email to notify me of problems.&lt;/li&gt; &#xD;
  &lt;/ul&gt; &#xD;
  &lt;h2&gt;Security&lt;/h2&gt; &#xD;
  &lt;p&gt;The escape function is VERY important as it will prevent basic sql injection attacks. A lot of beginners forget this. &lt;/p&gt; &#xD;
  &lt;p&gt;You should avoid printing error messages to the screen, as this can aid hackers. So try not to use &amp;quot;or die(mysql_error())&amp;quot;. Instead use a custom error handler as demonstrated above.&lt;br /&gt;&lt;/p&gt; &#xD;
  &lt;p&gt;&lt;br /&gt;&lt;/p&gt;</summary><link href="http://www.adamjimenez.com/blog/web-development/php-mysql-insert"/></entry><entry><title>Web Development Forums</title><summary type="html">&lt;p&gt;I've recently joined a bunch of web development forums to see if can help PHP rookies and simultaneously get my name about. I don't tend to post questions in forms that much because I can normally figure stuff out or find the answer on google. So instead I'm looking to answer some questions and play a more active role in the PHP community.&lt;/p&gt;&#xD;
  &lt;p&gt;These are the forums I've joined:&lt;/p&gt;&#xD;
  &lt;ul&gt;&#xD;
    &lt;li&gt;&lt;a href="http://webforumz.com/"&gt;WebForumz.com&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&#xD;
    &lt;li&gt;&lt;a href="http://www.devhunters.com/"&gt;DevHunters.com&lt;/a&gt;&lt;/li&gt;&#xD;
    &lt;li&gt;&lt;a href="http://www.sitepoint.com/forums/"&gt;SitePoint&lt;/a&gt;&lt;/li&gt;&#xD;
    &lt;li&gt;&lt;a href="http://www.webdevforums.com/"&gt;WebDevForums.com&lt;/a&gt;&lt;/li&gt;&#xD;
    &lt;li&gt;&lt;a href="http://forums.devshed.com/"&gt;DevShed&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&#xD;
  &lt;/ul&gt;&#xD;
  &lt;p&gt;Of these so far sitepoint seems to be the most active and interesting.&lt;/p&gt;</summary><link href="http://www.adamjimenez.com/blog/web-development/web-development-forums"/></entry><entry><title>Plesk 9.2.1 Migration Problems</title><summary type="html">&lt;p&gt;I think it was around Plesk 8.3 where everything in Plesk worked just about perfect. Since then Plesk 9 came out. I rushed to upgrade to Plesk 9 as soon as it was available. It had no discernible benefits and broke a lot of things like:&lt;/p&gt; &#xD;
  &lt;ul&gt; &#xD;
    &lt;li&gt;stopping email from working&lt;/li&gt; &#xD;
    &lt;li&gt;automatically suspending domains when they went over quota&lt;/li&gt; &#xD;
    &lt;li&gt;new interface where it's almost impossible to find anything&lt;/li&gt; &#xD;
    &lt;li&gt;missing icons in said crappy interface&lt;/li&gt; &#xD;
  &lt;/ul&gt; &#xD;
  &lt;p&gt;I managed to sort most of these out but if this wasn't enough in version 9 they had omitted the Plesk migration manager. Now this is pretty fundamental for transferring sites to different servers. You can supposedly do this with the backup/ restore program but it's a lot more complicated and buggy in my experience.&lt;/p&gt; &#xD;
  &lt;p&gt;So anyway 5 months later we have Plesk 9.2.1 which has migration manager.&lt;/p&gt;I migrated close to 100 domains. The migration was absolute hell and took the best part of 12 hours.&#xD;
Here's what I've learned about migration manager in Plesk 9.2.1:&lt;br /&gt; &#xD;
  &lt;ul&gt; &#xD;
    &lt;li&gt;Plesk Migration Manager won't anticipate lack of resources like domain limit/ disk space. So make sure you have plenty of both before you start.&lt;br /&gt;&lt;/li&gt; &#xD;
    &lt;li&gt;when initiating a migration &amp;quot;host inaccessible&amp;quot; can also mean login incorrect&lt;/li&gt; &#xD;
    &lt;li&gt;IP's must be set to shared to be picked up by the migration manager.&lt;/li&gt; &#xD;
    &lt;li&gt;if an IP is in use, Plesk won't let you change it to shared. altho you can over-ride this in the MySQL table called ip_pool.&lt;/li&gt; &#xD;
    &lt;li&gt;spam white-lists and black-lists are not migrated.&lt;/li&gt; &#xD;
    &lt;li&gt;mysql stored procedures are not migrated.&lt;/li&gt; &#xD;
    &lt;li&gt;after migration many sites were defaulting to the default plesk page. I had to stop/start them to get them to work.&lt;/li&gt; &#xD;
    &lt;li&gt;when stopping/starting close to 100 domains at once Plesk freezes up and can take literally hours to recover.&lt;/li&gt; &#xD;
    &lt;li&gt;one&#xD;
site in particular wouldn't migrate. it kept coming up with migration&#xD;
failed. i tried 5 times with different settings. Maybe because it was .tv - there isn't anything else perculiar about&#xD;
that domain. I finally managed to transfer it using the &lt;a target="_blank" href="http://kb.parallels.com/en/5969"&gt;backup / restore&#xD;
facility&lt;/a&gt;..&lt;/li&gt; &#xD;
    &lt;li&gt;Some folders were created with incorrect permissions. This is easy to fix - but I'm not sure why that should happen.&lt;/li&gt; &#xD;
  &lt;/ul&gt; &#xD;
  &lt;p&gt;Everything seems to be working ok now. I think I will wait a while and monitor the &lt;a href="http://forum.parallels.com/forumdisplay.php?f=208"&gt;plesk forums&lt;/a&gt; before I upgrade to the next version of Plesk.&lt;/p&gt;</summary><link href="http://www.adamjimenez.com/blog/general/plesk-migration-hell"/></entry><entry><title>Smarty Templating System</title><summary type="html">&lt;p&gt;&lt;a href="http://www.smarty.net/"&gt;&lt;img align="right" src="http://www.smarty.net/gifs/smarty-logo-orange.gif" /&gt;&lt;/a&gt;After working on several projects with web designers it soon became apparent that after I'd added my programming it became very difficult for the designer to maintain. What I needed was a way to separate the programming from the design. It was around then that I came across &lt;a href="http://www.smarty.net/"&gt;Smarty - PHP templating system&lt;/a&gt;. At the time Smarty was an official sub-project of PHP which gave it a big boost over it's competitors in my eyes.&lt;/p&gt; &#xD;
  &lt;p&gt;I used smarty in a few projects and quite liked it. It was like learning a new language as there is quite a lot of new functions to learn. Some of these functions are great but some are just equivalents of PHP functions because PHP can't be used directly in a template. I also had some issues to overcome - like making sure certain pages didn't get cached and that all variables had been correctly declared - or else they would not appear on the page.&lt;/p&gt; &#xD;
  &lt;p&gt;&amp;nbsp;I found that altho the pages were easier to edit than what I had done before they still had a few issues for designers. A lot of designers use dreamweaver and were  put off when the CSS and images weren't displaying in design mode because the template was in a different path. Also whereas before PHP blocks would be hidden behind a PHP icon, now the Smarty code was fully displayed and looked like page content and could be mistakenly edited. The idea behind Smarty code is that it's supposed to be easier to understand for designers. In practice I've found that designers probably don't fully understand code however it's presented / and nor should they need to.&lt;/p&gt; &#xD;
  &lt;p&gt;Smarty added a bit of bloat to my projects and also became another thing to maintain - having to upgrade all projects with the latest version of smarty and hoping nothing breaks. And a few times I'd been caught out when projects had moved servers and I hadn't checked the permissions on the template cache folder - which isn't always obvious to spot.&lt;/p&gt; &#xD;
  &lt;p&gt;So because of these issues, I stopped using Smarty and developed &lt;a href="http://lib.shiftcreate.com/tpl_format"&gt;my own templating system&lt;/a&gt; which is a lot simpler and is all done in PHP and doesn't require you to learn a new language. It's friendlier for designers and has some built-in SEO goodness like search engine friendly URLs, automated page titles and dynamic sitemaps. I've since re-written all active projects that used Smarty to take advantage of this new format.&lt;br /&gt;&lt;/p&gt; &#xD;
  &lt;p&gt;On reflection Smarty was not the best solution for me. However it did teach me the fundamental importance of keeping code separate from design. I also learned from it some fantastic functions for dealing with html drop-downs and date/time selections which I've subsequently adapted and use in my own projects. So while I wouldn't recommend it, I've definitely benefited from the experience.&lt;br /&gt;&lt;/p&gt;</summary><link href="http://www.adamjimenez.com/blog/web-development/smarty-templating-system"/></entry><entry><title>Why Choose PHP?</title><summary type="html">&lt;p&gt;There are a fair few choices of server side languages to choose from the grandaddy perl to relatively new trendy languages like ruby or python. Somewhere in the middle is PHP.&lt;/p&gt; &#xD;
  &lt;p&gt; PHP is open source and has been ported to many operating systems including linux. windows and mac. This open source philosophy extends to a wealth of free resources including tutorials, classes and components. There is some fantastic open source PHP software such as &lt;a href="http://www.phpbb.com/" target="_blank"&gt;phpBB&lt;/a&gt;, &lt;a href="http://www.phpmyadmin.net/" target="_blank"&gt;phpMyAdmin&lt;/a&gt; and &lt;a href="http://www.aditus.nu/jpgraph/" target="_blank"&gt;JpGraph&lt;/a&gt;. This is in stark contrast to the closed source ASP which many basic components are paid-for.&lt;/p&gt; &#xD;
  &lt;p&gt; PHP is a C-based language so if you have any experience with C or other C-based languages like JavaScript you should find the syntax easy to learn. Debugging is normally pretty easy as error messages are straight-forward and clearly identity where and what error occurred.&lt;br /&gt;&lt;/p&gt; &#xD;
  &lt;p&gt;PHP is all about rapid application development. There are a number of built-in extensions and out-of-the-box you can use PHP to manipulate images, send emails, execute shell commands and much much more.&lt;/p&gt; &#xD;
  &lt;p&gt;The hardest thing about PHP is learning all the different functions - there are thousands of them. And they don't all follow the same naming convention e.g. addslashes() / str_replace(). Luckily the &lt;a href="http://www.php.net/" target="_blank"&gt;php.net&lt;/a&gt; website is at hand. It provides comprehensive easy-to-follow documentation on all functions with clear examples. There is also a lot of crucial information and sample code in the comments.&lt;/p&gt; &#xD;
  &lt;p&gt;In summary PHP is a great choice. It's free, well-supported and easy to learn. Long live PHP!&lt;br /&gt;&lt;/p&gt;</summary><link href="http://www.adamjimenez.com/blog/web-development/why-choose-php"/></entry><entry><title>drupal / joomla / mambo etc</title><summary type="html">&lt;p&gt;There is q&lt;img align="right" src="http://www.adamjimenez.com/uploads/cms.png" /&gt;uite a bit of hype surrounding open source systems like &lt;/p&gt; &#xD;
  &lt;ul&gt; &#xD;
    &lt;li&gt;drupal&lt;/li&gt; &#xD;
    &lt;li&gt;joomla&lt;/li&gt;&#xD;
    &lt;li&gt;mambo&lt;/li&gt; &#xD;
    &lt;li&gt;etc&lt;br /&gt;&lt;/li&gt; &#xD;
  &lt;/ul&gt; &#xD;
  &lt;p&gt;I've looked into them but have so far&#xD;
avoided using them.&lt;/p&gt; &#xD;
  &lt;p&gt;I'm not against these systems per se. I think they are good for&#xD;
non-profits or sites with limited budgets. They allow peeps who&#xD;
aren't web developers to create and manage their own fairly&#xD;
sophisticated web-sites. But this is also part of the problem, it's&#xD;
almost like Frontpage for PHP. It allows them to create a functional&#xD;
system very easily. But as soon as they have to customise it in a way&#xD;
which wasn't originally intended; they start hitting brick walls.&#xD;
Either that or the systems are over-complicated to use.&lt;br /&gt; &lt;br /&gt;Every website is different. And a lot of websites have unique&#xD;
features which are different to any other site. At some point you have&#xD;
to get down and dirty and write some proper code and not expect a&#xD;
system to do it all for you.&lt;br /&gt; &lt;br /&gt;And what happens if the system you are using is no longer&#xD;
supported, or an upgrade comes along that breaks your existing&#xD;
site or modules?&lt;/p&gt; &#xD;
  &lt;p&gt;So what's the alternative?&lt;/p&gt; &#xD;
  &lt;p&gt;Well here's what I do. I've developed a generic/ flexible &lt;a href="http://www.shiftcreate.com/services/cms"&gt;CMS system&lt;/a&gt; that I use for a back-end on all my CMS projects. The front-end is always coded from scratch. This gives the designers complete freedom to design the site anyway they see fit and I integrate the CMS into their design. Over the years I've developed a &lt;a href="http://lib.shiftcreate.com/"&gt;core library&lt;/a&gt; that speeds up development by taking care of ecommerce/ account logins etc. But at all times I've got complete control over the functionality.&lt;/p&gt; &#xD;
  &lt;p&gt; &lt;/p&gt; &#xD;
  &lt;p&gt;some interesting quotes from a &lt;a href="http://www.example.com/" target="_blank"&gt;slashdot article on drupal&lt;/a&gt;:&lt;/p&gt; &#xD;
  &lt;p&gt;&lt;em&gt;Recently we managed to phase out our corporate drupal-based site. It&#xD;
was close to impossible to upgrade from Drupal 4.x up to 5.x (and 6.x)&#xD;
because of custom modules and we have no human resources to recode&#xD;
someone's crap from version to version every year.&lt;/em&gt;&lt;/p&gt; &lt;hr /&gt; &#xD;
  &lt;p&gt;&lt;em&gt; Don't even talk about &amp;quot;Joomla&amp;quot; and &amp;quot;Mambo&amp;quot;. They're a nightmare to&#xD;
maintain, and a royal pain in the ASS for building an SEO friendly site&#xD;
with friendly URL's that don't look like a matrix reloaded computer&#xD;
screenshot.&lt;/em&gt;&lt;/p&gt; &lt;hr /&gt; &#xD;
  &lt;p&gt;&lt;em&gt;The problem is, the moment you make the mistake of thinking you're&#xD;
going to add fields to modules, apply true custom skins to them,&#xD;
rearrange their content, etc. on top of an already largely built&#xD;
framework, it very quickly falls apart. You get two choices at that&#xD;
point: add on systems that kinda sorta give you some of what you need&#xD;
but still leave you limited or hacking in to the source code that's&#xD;
really not built with that kind of customization in mind.&lt;/em&gt; &lt;/p&gt; &lt;hr /&gt; &#xD;
  &lt;p&gt;&lt;em&gt;I spent months with Drupal, tracking the boards, reading the docs,&#xD;
listening to many podcast series. But I came away feeling that, despite&#xD;
its many features and modules, it's quite kludgey.&lt;/em&gt;&lt;/p&gt; &#xD;
  &lt;p&gt; &lt;/p&gt; &#xD;
  &lt;p&gt;And this one:&lt;/p&gt; &#xD;
  &lt;p&gt;&lt;a href="http://books.slashdot.org/article.pl?sid=09/05/18/139218&amp;amp;from=rss"&gt;http://books.slashdot.org/article.pl?sid=09/05/18/139218&amp;amp;from=rss&lt;/a&gt; &lt;br /&gt;&lt;/p&gt; &#xD;
  &lt;p&gt;I'm so tired of taking over sites where the former &amp;quot;developer&amp;quot; used a Drupal or Joomla installation.&lt;/p&gt; &#xD;
  &lt;p&gt;It&#xD;
is inevitable that the requirements of a custom web app will eventually&#xD;
exceed the capability of these systems. Knowledge of a particular CMS&#xD;
does not a developer make! These are tools in a toolbox and should be&#xD;
used as such. I hate it when people sell themselves as freelance&#xD;
&amp;quot;programmers&amp;quot;, but really they only know how to use a particular CMS.&#xD;
So lets write a book and encourage this behavior - bluagh..&lt;/p&gt; &#xD;
  &lt;p&gt; &lt;/p&gt; &#xD;
  &lt;p&gt; &lt;/p&gt;&lt;hr /&gt; &#xD;
  &lt;p&gt; I still have some websites lingering around that use Joomla but I am&#xD;
very much dissociated with that CMS, infact any CMS nowadays. I find&#xD;
the issues that these systems bring to the table far outweigh any&#xD;
little added productivity that a small group can sustain. There are&#xD;
teams of script kiddies from Asia and elsewhere scouring online&#xD;
websites for these systems to prove just how easy they are to hack&#xD;
into. If you have an online database with confidential client&#xD;
information, you are in trouble.&#xD;
&lt;/p&gt; &lt;hr /&gt;&#xD;
  &lt;p&gt;&amp;nbsp;The problem with popular CMS systems today stems from the tight coupling of back-end architecture and front-end architecture.&lt;br /&gt; &lt;br /&gt;&#xD;
Remove the coupling, and the need for a book on Front End Drupal&#xD;
vanishes, leaving us with a simple API which we can integrate with our&#xD;
own custom or third party front-end. &lt;br /&gt;&lt;/p&gt;&#xD;
  &lt;p&gt; &lt;/p&gt;</summary><link href="http://www.adamjimenez.com/blog/web-development/drupal-joomla-wordpress-mambo-etc"/></entry><entry><title>PHP short tags are ok</title><summary type="html">&lt;p&gt;&lt;img align="right" src="http://www.adamjimenez.com/uploads/short_tags.gif" /&gt;PHP code blocks are usually started one or two ways. Either by using the full PHP tag: &amp;lt;?php or the short-hand tag, which is just &amp;lt;?. The short-hand tag allows you to do: &amp;lt;?=$var;?&amp;gt; which is the equivalent of &amp;lt;?php echo $var;?&amp;gt;. This is a lot more concise and when you develop as much as I do it's a real time-saver and is more readable.&lt;/p&gt; &#xD;
  &lt;p&gt;PHP short tags are &lt;a target="_blank" href="http://uk2.php.net/manual/en/ini.core.php#ini.short-open-tag"&gt;enabled by default&lt;/a&gt; in PHP although they are officially discouraged because of a potential collision with xml. XML blocks start with &amp;lt;?xml&lt;/p&gt; &#xD;
  &lt;p&gt;The other arguments against short-tags is portability. Some web hosts won't have short-tags enabled by default. This is pretty easy to remedy - either by editing the php.ini file or adding a htaccess file. &lt;br /&gt;&lt;/p&gt; &#xD;
  &lt;p&gt;Now some PHP purists will say that anyone who uses short tags is error prone or antiquated. This is simply unfounded as short tags are not deprecated and as long as you are aware of the shortcomings; won't cause you any more errors..&lt;br /&gt;&lt;/p&gt; &#xD;
  &lt;p&gt;PHP6 is going to be a major shake up to PHP - a lot of things are going to go like safe-mode / register globals etc. But &lt;a target="_blank" href="http://www.corephp.co.uk/archives/19-Prepare-for-PHP-6.html"&gt;it would appear that short-tags will be staying&lt;/a&gt;. Probably due to the sheer amount of code and rebel coders that rely on them.&lt;/p&gt; &#xD;
  &lt;p&gt;Now for super-standards-compliant perfecto projects it may be sensible to use the full PHP tags. But for standard every day use, short tags are ok - so don't let the nay-sayers put you off.&lt;br /&gt;&lt;/p&gt;</summary><link href="http://www.adamjimenez.com/blog/web-development/PHP-short-tags-are-ok"/></entry><entry><title>AdamJimenez.com launch</title><summary type="html">&lt;p&gt;Welcome to my new bloggy / profile type site. I'm a freelance developer who has been developing websites for around 12 years.&lt;/p&gt; &#xD;
  &lt;p&gt;The purpose of this site is to act as a hub for my social networks. And to blog about life as a web developer as I dabble with code and develop websites.&lt;br /&gt;&lt;/p&gt;</summary><link href="http://www.adamjimenez.com/blog/general/adamjimenez-launch"/></entry></feed>
