<?xml version="1.0" encoding="iso-8859-1"?>
<!-- PHP/XML RSS Feed by Charanjit Chana - http://www.cchana.co.uk for Be Unequaled -->
<rss version="2.0">
   <channel>
      <title>Charanjit Chana's Blog</title>
      <link>http://blog.charanj.it</link>
      <description>The personal blog of Charanjit Chana</description>
      <language>en-uk</language>
      <category>Technology, design, programming, sport, entertainment</category>
      <pubDate>Fri, 10 Sep 2010 13:13:02 -0700</pubDate>
      <lastBuildDate>Fri, 27 Aug 2010 16:47:38 -0700</lastBuildDate>     
      <docs>http://www.rssboard.org/rss-specification</docs>
      <managingEditor>hello@charanj.it</managingEditor>
      <webMaster>hello@charanj.it</webMaster>
    <item>
                      <title>UK Government's response to IE6 petition</title>
	              <link>http://blog.charanj.it/post/172/uk-government-s-response-to-ie6-petition</link>
	              <description><![CDATA[
	              <p>A few months ago I was one of more than 6,000 people to <a href="http://www.hmg.gov.uk/epetition-responses/petition-view.aspx?epref=ie6upgrade" onclick="window.open(this.href); return false;">sign a petition</a> that asked the UK Government to encourage departments to upgrade from IE6 to better browsers.<br />
<br />
Unfortunately, the response was as expected. Unlike other EU countries that have discouraged the use of IE6, the Government felt it necessary to fall in line with the infinite number of lazy IT departments around the company that feel that the time spending upgrading IE6 to be expensive and unnecessary.<!--fold--><br />
<br />
In an effort to avoid malware, viruses and all other manor of other internet evils, companies (and probably the Government itself) probably spend millions and millions of pounds on spyware, virus scanners and ant-virus software. Now THAT is a waste of money considering ALL browser upgrades are <strong>FREE</strong>.<br />
<br />
OK, so there may be the need to risk assessments and other political/safety issues that surround most software installations, but at the end of that cycle there is absolutely NO ongoing cost attached to a browser upgrade. None at all!<br />
<br />
If these departments were to upgrade their users (not an easy task, I know), then these users would be at the cutting edge of the web, Microshite wouldn't need support an ageing (10 years now) browser until 2014 and we could see a real push for technologies like CSS3 and HTML5.<br />
<br />
Apple has done a great job at pushing support for CSS3 and HTML5 thanks to their involvement with the standards and the push of the webkit platform.<br />
<br />
The German and French Governments are leading the way and the UK Government really should be following their example.</p>
	              ]]></description>
	              <pubDate>Sun, 1 Aug 2010 20:13:54</pubDate>
	            </item>
		    <item>
                      <title>Installing PHPUnit with Terminal on OS X Snow Leopard</title>
	              <link>http://blog.charanj.it/post/171/installing-phpunit-with-terminal-on-os-x-snow-leopard</link>
	              <description><![CDATA[
	              <p>This article will be posted twice, this version is for version of PHP included with Snow Leopard. The next version will cover MAMP.<br />
<br />
I've struggled with this 3 times now (twice on a Mac and once on a PC) and it's time I documented what worked for me!<br />
<br />
With MAMP installed, I launched Terminal and typed in:<br />
<br />
</p><div class="pre code"><pre>sudo pear channel-discover pear.phpunit.de</pre></div><p><br />
<br />
then<br />
<br />
</p><div class="pre code"><pre>sudo pear channel-discover pear.symfony-project.com</pre></div><p><br />
<br />
and then<br />
<br />
</p><div class="pre code"><pre>sudo pear install phpunit/PHPUnit</pre></div><p><br />
<br />
</p>
	              ]]></description>
	              <pubDate>Wed, 5 May 2010 15:46:19</pubDate>
	            </item>
		    <item>
                      <title>gCount, a Google Code counter</title>
	              <link>http://blog.charanj.it/post/169/gcount-a-google-code-counter</link>
	              <description><![CDATA[
	              <p>As part of the Nike+PHP project, I wanted to display the download count for the project. Mainly as a badge of pride, but also as a tool I can use to gauge the popularity of the project.<br />
<br />
Google don't offer anything like this on their own site, let alone as a widget, so I launched <a href="http://gcount.charanj.it" onclick="window.open(this.href); return false;">gCount</a> this week.<br />
<br />
Entering your Google Code project name will return a total download count and some JavaScript you can pop onto your website that will display the same count.<br />
<br />
I'll post updates to [http://twitter.com/cchana]twitter[/url] if I make any enhancements and maybe even promote projects using the service!</p>
	              ]]></description>
	              <pubDate>Thu, 1 Apr 2010 08:41:59</pubDate>
	            </item>
		    <item>
                      <title>Nike+PHP's new home</title>
	              <link>http://blog.charanj.it/post/168/nike-php-s-new-home</link>
	              <description><![CDATA[
	              <p>While the code itself still sits over on Google Code, <a href="http://nikeplusphp.org" onclick="window.open(this.href); return false;">Nike+PHP's support site now has a new look</a>!<br />
<br />
I've moved it onto a Wordpress platform which makes administration and updating the site easier.</p>
	              ]]></description>
	              <pubDate>Thu, 11 Mar 2010 10:10:52</pubDate>
	            </item>
		    <item>
                      <title>Nike+PHP progress and branding</title>
	              <link>http://blog.charanj.it/post/167/nike-php-progress-and-branding</link>
	              <description><![CDATA[
	              <p>Version 1 or Nike+PHP has been out for a while and earlier this month I released v1.2.1.<br />
<br />
The code has been downloaded over 100 times and I'm extremely proud of that fact! I would love to see how people are using the code, so please add to the Examples page on the <a href="http://code.google.com/p/nike-plus-php/w/list" onclick="window.open(this.href); return false;">wiki</a>.<br />
<br />
I also changed the branding for the project a little bit, but need time to work on the site, something I might do in March. The site is a little bright, something I wanted it to be, but I'll be toning it down a bit in the next refresh.<br />
<br />
The old logo was dark, plain and, well, just boring!<br />
<br />
<img src="http://nikeplusphp.org/elements/nikeplusphp.png" alt="image" /><br />
<br />
The new one is lighter, has a bit of depth and contains the Nike logo (hope I don't get into any trouble for that!).<br />
<br />
<img src="http://nikeplusphp.org/elements/nike+phplogo.png" alt="image" /></p>
	              ]]></description>
	              <pubDate>Fri, 19 Feb 2010 16:55:21</pubDate>
	            </item>
		    <item>
                      <title>Blurred text in CSS</title>
	              <link>http://blog.charanj.it/post/164/blurred-text-in-css</link>
	              <description><![CDATA[
	              <p>It's possible to make text looked blurred using just CSS3. See the examples below, just hover over the first bit of text to see the possibility of using blurred text as a hover state.<br />
<br />
<style type="text/css">h1.blurred { color: #000; } div.shadow-box { background-color: #000; border-radius: 10px; -moz-border-radius: 10px; -webkit-border-radius: 10px; height: 100px; width: 100px; } div.shadow-box:hover { background-color: #888; box-shadow: 0 0 5px #000; -moz-box-shadow: 0 0 5px #000; -webkit-box-shadow: 0 0 5px #000; } h1.blurred:hover, .already { cursor: pointer; color: #888!important; text-shadow: 0 0 5px #222; }</style><h1 class="blurred">Some blurred text</h1><h1 class="blured already">Some blurred text</h1><br />
<div class="shadow-box""></div><br />
Above, you can see some examples of blurred text in browsers that support CSS3<br />
<br />
The trick is to change the colour of the element and either apply the <em>text-shadow</em> or <em>box-shadow</em> properties through CSS. Using the <em>:hover</em> pseudo-class you can create a blurred/unblurred effect<br />
<br />
</p><h4>Example:</h4><p><br />
<strong>HTML:</strong><br />
</p><div class="pre code"><pre>
&amp;lt;h1 class=&amp;quot;blurred&amp;quot;&amp;gt;Blurred text&amp;lt;/h1&amp;gt;
</pre></div><p><br />
<br />
<strong>CSS:</strong><br />
</p><div class="pre code"><pre>
h1.blurred {
	color: #FFF;
}
h1.blurred:hover {
	cursor: pointer;
	color: #666!important;
	text-shadow: 0 0 5px #444;
}
</pre></div><p><br />
<br />
The colours need to be selected carefully, as the shadows are often a bit lighter than the foreground text colour. Shadow size also plays a role. 5px seems to be effective, but 10px can wash the colour out.<br />
<br />
To apply the effect to a block element, you'll need to use the <em>box-shadow</em> property instead of the <em>text-shadow</em> property, but otherwise it's the the same.<br />
<br />
For more effects, you could apply opacity to make the text a little see through and see how that works out!<br />
<br />
If you find this useful, please check out my <a href="http://charanj.it?ref=blurred-text" onclick="window.open(this.href); return false;">portfolio site</a>.</p>
	              ]]></description>
	              <pubDate>Tue, 22 Dec 2009 15:41:45</pubDate>
	            </item>
		    <item>
                      <title>Nike+PHP a PHP class for Nike+</title>
	              <link>http://blog.charanj.it/post/160/nike-php-a-php-class-for-nike-</link>
	              <description><![CDATA[
	              <p>So I am a lover of Nike+ and have had a <a href="http://blog.charanj.it/post/65/nike-blog-feature" onclick="window.open(this.href); return false;">Nike+ stat widget</a> on the side of my blog for quite a while now. The project can be found at <a href="http://nikeplusphp.org" onclick="window.open(this.href); return false;">http://nikeplusphp.org</a>.<br />
<br />
It came to my attention that the method used wasn't the easiest and certainly wasn't up to date. Looks like something changed on Nike's end and that has broken the API I was using.<br />
<br />
Looking around for an alternative, I was inspired to build my own class and am now firmly at version 0.7 with it. I've created a small website for the project where you can grab the code and there's some documentation to help you get started.<br />
<br />
The project is called <a href="http://nikeplusphp.org" onclick="window.open(this.href); return false;">Nike+<strong>PHP</strong></a> and all you need is a Nike+ account, PHP5 and SimpleXML installed.<!--fold--><br />
<br />
The class grabs all the info and creates a PHP array that's easy to use. I'll be updating it whenever I get a chance and will try to get a mailing list up and running so that you are able to keep the code up to date.<br />
<br />
If you have any problems, need help or have any suggestions, please feel free to let me know (via email: hello [at] charanj.it) and I'll do my best help.</p>
	              ]]></description>
	              <pubDate>Mon, 5 Oct 2009 09:08:40</pubDate>
	            </item>
		    <item>
                      <title>PHP - deleting cookies</title>
	              <link>http://blog.charanj.it/post/159/php-deleting-cookies</link>
	              <description><![CDATA[
	              <p>I had an issue where I couldn't delete cookies today. Turns out, adding the path works.<br />
<br />
</p><div class="pre code"><pre>
&amp;lt;?php
setcookie('name', 'value', time()+3600);
?&amp;gt;
</pre></div><p><br />
<br />
The above would set a cookie for one hour into the future.<br />
<br />
</p><div class="pre code"><pre>
&amp;lt;?php
setcookie('name', 'value', time()-3600);
?&amp;gt;
</pre></div><p><br />
<br />
The above should set a cookie for one hour into the past, making it expire and effectively deleting it. Today, this wasn't the case, but adding a path did the trick.<br />
<br />
</p><div class="pre code"><pre>
&amp;lt;?php
setcookie('name', 'value', time()+3600, '/');
?&amp;gt;
</pre></div><p><br />
<br />
The above sets it for an hour and for the whole domain. Adding the '/' to both the setting and expiring did the trick!<br />
<br />
<br />
</p>
	              ]]></description>
	              <pubDate>Tue, 25 Aug 2009 11:19:05</pubDate>
	            </item>
		    <item>
                      <title>Photos from FOWD</title>
	              <link>http://blog.charanj.it/post/156/photos-from-fowd</link>
	              <description><![CDATA[
	              <p>I've been uploading some photos throughout the day here at FOWD. Take a look at the slideshow below, or check out my <a href="http://www.flickr.com/photos/cchana/sets/72157617507101524/" onclick="window.open(this.href); return false;">Flickr</a> set.<br />
<br />
</p><div class="flashcontent"><object width="400" height="300"> <param name="flashvars" value="offsite=true&amp;amp;#9001;=en-us&amp;amp;page_show_url=%2Fphotos%2Fcchana%2Fsets%2F72157617507101524%2Fshow%2F&amp;amp;page_show_back_url=%2Fphotos%2Fcchana%2Fsets%2F72157617507101524%2F&amp;amp;set_id=72157617507101524&amp;amp;jump_to="></param> <param name="movie" value="http://www.flickr.com/apps/slideshow/show.swf?v=71649"></param> <param name="allowFullScreen" value="true"></param><embed type="application/x-shockwave-flash" src="http://www.flickr.com/apps/slideshow/show.swf?v=71649" allowFullScreen="true" flashvars="offsite=true&amp;amp;#9001;=en-us&amp;amp;page_show_url=%2Fphotos%2Fcchana%2Fsets%2F72157617507101524%2Fshow%2F&amp;amp;page_show_back_url=%2Fphotos%2Fcchana%2Fsets%2F72157617507101524%2F&amp;amp;set_id=72157617507101524&amp;amp;jump_to=" width="400" height="300"></embed></object></div><p><br />
<br />
<span class="strikethrough">As we speak only photos I could Bluetooth to my phone have been added, will upload some more from my</span> More photos added from my <a href="http://www.flickr.com/photos/cchana/sets/72157616668367094/" onclick="window.open(this.href); return false;">minimo</a> <span class="strikethrough">later!</span></p>
	              ]]></description>
	              <pubDate>Thu, 30 Apr 2009 16:11:58</pubDate>
	            </item>
		    <item>
                      <title>FOWD 2009, I'm going and I can't wait! :)</title>
	              <link>http://blog.charanj.it/post/154/fowd-2009-i-m-going-and-i-can-t-wait-</link>
	              <description><![CDATA[
	              <p>Tomorrow is the Future Of Web Design conference and I really can't wait to go!<br />
<br />
There are a few topics I'll be really interested in and I am looking forward to learning lots more about the industry and where things are headed.<br />
<br />
I'm still debating, but I think I'll be taking my laptop. All I'll be doing is taking notes, but I'll have my iPod and hopefully there'll be wifi so I'll be able to check in on emails too!</p>
	              ]]></description>
	              <pubDate>Wed, 29 Apr 2009 20:02:31</pubDate>
	            </item>
		    <item>
                      <title>receeve.it almost ready, while AdSense just isn't cutting it right now</title>
	              <link>http://blog.charanj.it/post/153/receeve-it-almost-ready-while-adsense-just-isn-t-cutting-it-right-now</link>
	              <description><![CDATA[
	              <p>During the winter of 2007, Google AdSense just worked so well for me. 12 months later and it was hard to replicate even a quarter of what the previous year had offered. To be fair, due to a lack of time and effort, other advertising avenues also dried up and I had to make changes.<br />
<br />
I made some, but nothing I did ever helped to recover the revenue. A few months on and I decided to close Be Unequaled and Billionaire-Boys-Club.co.uk for good. I have plans for the former and ideas for the other, but nothing in the immediate feature.<br />
<br />
<a href="http://receeve.it" onclick="window.open(this.href); return false;">receeve.it</a> is ready for a BETA launch and you can either signup on the homepage for future news or readers of this post can <a href="http://beta.receeve.it" onclick="window.open(this.href); return false;">register</a> for real on the BETA site before we even launch!<br />
<br />
I aim to continuously improve the site where time allows and one of the main aspects of that is revenue.<br />
<br />
Google AdSense is currently in place and while I'm making just pennies a day, I'm hoping a web application will serve up a better click through rate than a forum/blog can. I have other ideas for revenue, so I'm not relying on Google to make receeve.it self sufficient, but it could play a key role IF it begins to pay at levels it was back in 2007.</p>
	              ]]></description>
	              <pubDate>Tue, 21 Apr 2009 17:32:09</pubDate>
	            </item>
		    <item>
                      <title>New Sky project finished, the new Money &amp; Property site</title>
	              <link>http://blog.charanj.it/post/148/new-sky-project-finished-the-new-money-property-site</link>
	              <description><![CDATA[
	              <p>Over the last few months we've been working hard to get the new combined <a href="http://money.sky.com" onclick="window.open(this.href); return false;">Money &amp;amp; Property</a> site up and running.<br />
<br />
We're really happy with how it turned out because it looks great and we believe it's faster than the old site! We launched on Wednesday after a big effort by everyone involved. Take a look at the site and let me know what you think!</p>
	              ]]></description>
	              <pubDate>Fri, 13 Mar 2009 12:34:20</pubDate>
	            </item>
		    <item>
                      <title>Be Unequaled now closed, receeve.it soon?</title>
	              <link>http://blog.charanj.it/post/142/be-unequaled-now-closed-receeve-it-soon-</link>
	              <description><![CDATA[
	              <p>Today is the 1st of February and as promised, <a href="http://www.beunequaled.com" onclick="window.open(this.href); return false;">Be Unequaled</a> is no more. Due to a lack of time on my part and the continued decline in activity, I feel it was the right thing to do. I am sad to see the site come to an end, but it really felt like the right thing to do.<br />
<br />
As for <a href="http://receeve.it" onclick="window.open(this.href); return false;">receeve.it</a>, things are coming on along nicely! I have a few small features left to polish off and the layout needs some work, but we're pretty much there.<br />
<br />
Luckily, I have a holiday coming up over which time I believe I'll have no, or very little, internet access. I aim to take a bit of time off from development and get my head ready for an onslaught when I'm back! This will all be in the aid of getting a BETA version out by the end of February or beginning of March. In the even that I don't get away, I'll still try to do that.<br />
<br />
If you want to keep up to date with <a href="http://receeve.it" onclick="window.open(this.href); return false;">receeve.it</a>, please register on the mailing list and follow the <a href="http://blog.receeve.it" onclick="window.open(this.href); return false;">blog</a> that I set up.</p>
	              ]]></description>
	              <pubDate>Sun, 1 Feb 2009 20:36:29</pubDate>
	            </item>
		    <item>
                      <title>Getting rid of 404 errors and finding rogue links</title>
	              <link>http://blog.charanj.it/post/127/getting-rid-of-404-errors-and-finding-rogue-links</link>
	              <description><![CDATA[
	              <p>One thing I've been meaning to do is to make sure that this site doesn't contain any 404 links. Easier said than done when a site has more than a handful of pages.<br />
<br />
Using the <a href="http://home.snafu.de/tilman/xenulink.html" onclick="window.open(this.href); return false;">Xenu Link Sleuth</a> I was able to determine where things may not be as they should be and eliminate as many of the problems as possible.<br />
<br />
I need to find a Mac alternative, but the Xenu software is perfect for finding 404's. I'm running another report as I type, but before I wrote this post, this blog had over 4,000 urls!</p>
	              ]]></description>
	              <pubDate>Fri, 28 Nov 2008 11:55:27</pubDate>
	            </item>
		    <item>
                      <title>Flash AS3 sucks balls (kinda)</title>
	              <link>http://blog.charanj.it/post/121/flash-as3-sucks-balls-kinda-</link>
	              <description><![CDATA[
	              <p>I know it is a step forward and probably makes it easier to develop more complex applications, but I really wish the syntax was backwards compatible and a little less rigid. I do like the flexibility your allowed now in ActionScript, especially with better controls over how vectors are rendered (almost ala Photoshop) and gradient masks are awesome, but a big pain in my arse is the way it's written. With more use, I'm sure I'll get used to it, but I haven't enjoyed it so far and am not looking forward to our next appointment.</p>
	              ]]></description>
	              <pubDate>Mon, 3 Nov 2008 16:22:53</pubDate>
	            </item>
		    <item>
                      <title>Nice little function in PHP</title>
	              <link>http://blog.charanj.it/post/118/nice-little-function-in-php</link>
	              <description><![CDATA[
	              <p>Via a <a href="http://www.oreillynet.com/ruby/blog/2007/09/7_reasons_i_switched_back_to_p_1.html" onclick="window.open(this.href); return false;">Derek Sivers </a> post on O'Rielly, which was found via a blog post on <a href="http://www.nicedream.co.uk/blog/2008/10/28/getting_things_done/" onclick="window.open(this.href); return false;">Getting Things Done</a> by Nina Richards.<br />
<br />
<a href="http://en.wikipedia.org/wiki/Getting_Things_Done" onclick="window.open(this.href); return false;">Getting Things Done</a> is a concept I've heard about before and I will be researching more.<br />
<br />
Sivers' blog post introduced a really <a href="http://uk2.php.net/autoload" onclick="window.open(this.href); return false;">cool bit of code</a> I may use in the future which allows you to add other PHP files to your script without ever using the <a href="http://blog.charanj.it/post/30/php-includes-and-requires" onclick="window.open(this.href); return false;">include and require</a> functions!<br />
<br />
</p><div class="pre code"><pre>
&amp;lt;?php
function __autoload($class_name) {
    require_once $class_name . '.php';
}

$obj  = new MyClass1();
$obj2 = new MyClass2(); 
?&amp;gt;
</pre></div><p><br />
<br />
The function launches when ever a class is initiated, from what I can tell. Not sure how it would work with files held in multiple folders, as I like to do, but certainly a beautiful piece of kit... Also, not sure if the piece of code has to be written into each file or if you (ironically) have to include it! I'll be giving it a go and will report back.<br />
<br />
Some great user examples on the <a href="http://uk2.php.net/autoload" onclick="window.open(this.href); return false;">PHP.net</a> page too.</p>
	              ]]></description>
	              <pubDate>Tue, 28 Oct 2008 18:07:25</pubDate>
	            </item>
		    <item>
                      <title>Removing PHP cookies</title>
	              <link>http://blog.charanj.it/post/110/removing-php-cookies</link>
	              <description><![CDATA[
	              <p>If you set a cookie that covers all of the sub-domains of your site, you can't just unset the cookie in a casual way, you'll have to specify that the cookie set for all sub-domains should go.<br />
<br />
You can set a cookie for all sub-domains by specifying the domains as .domain.com - a period before the top level domain.<br />
<br />
I thought you could just unset the cookie by specifying the cookie's name, but that's not the case</p>
	              ]]></description>
	              <pubDate>Sat, 11 Oct 2008 09:50:49</pubDate>
	            </item>
		    <item>
                      <title>Blog improvements - SEO and spam</title>
	              <link>http://blog.charanj.it/post/105/blog-improvements-seo-and-spam</link>
	              <description><![CDATA[
	              <p>I have made a couple of changes to the blog this past week. Firstly, I've stopped comments being auto published. I need to refine this process somewhat, but after getting hit hard by spam, it was a necassary move.<br />
<br />
The second change I made was to increase the SEO a little more. I simply changed underscores to dashes in the URLs. Apart from that, all should be working fine. The underscore version of URLs still work, so results from search engines and external links will still work, but I am looking into taking it one step further and putting a permanent redirect in place.<br />
<br />
I also need to update internal links, but that is to come!</p>
	              ]]></description>
	              <pubDate>Mon, 6 Oct 2008 08:08:23</pubDate>
	            </item>
		    <item>
                      <title>Things that no web developer should forget (SEO)</title>
	              <link>http://blog.charanj.it/post/103/things-that-no-web-developer-should-forget-seo-</link>
	              <description><![CDATA[
	              <p>There are just some things that no front end developer should ever forget. There are so many things that often fall to the bottom of the list when developing something for the web, none more so than the ones I'll be highlighting here. It's often easy to forget small details, but when they're in they could make a big difference, especially when it comes to SEO and accessibility.<br />
<br />
</p><h4>Titles</h4><p><br />
Often in Firefox, I find myself with quite a few tags but some of them just show 'Untitled' which just isn't very useful. Some sort of identification is always welcome by the user, whether they've minimized or tabbed your page.<br />
<br />
</p><h4>Background color</h4><p><br />
This is a trivial issue and probably less than 0.1% of people will ever even notice it, but I will and it's a commonly forgotten bit of CSS or HTML when white backgrounds are used.<!--fold--><br />
<br />
Most, if not all, modern browsers have a white background set as the default, but if you change the settings to show a light grey background instead, you soon realize the number of developers who just simply forget an attribute when really, the case should be the opposite. This is something I picked up from a colleague of mine from my days at <a href="http://www.monkeehouse.com" onclick="window.open(this.href); return false;">Monkeehouse</a>, <a href="http://www.bytenoise.co.uk" onclick="window.open(this.href); return false;">Zoe Blade</a>.<br />
<br />
</p><h4>Alt tags</h4><p><br />
Whatever your feelings about accessibility, I think it's something that should always be considered. Whether client's require it or not, it often leads to code that's valid. Alt tags should be used wherever possible.<br />
<br />
Alt tags shouldn't be blank, but if there's nothing to say, don't say it. If you can't apply an alt tag, maybe consider making the image a background as this will keep it out of the page and hopefully increase load time for those not using visual browsers.<br />
<br />
At the moment, my BBCode doesn't support this, so I am guilty of not following this rule on some occasions, but I plan to make the necessary changes very soon.<br />
<br />
</p><h4>&amp;amp;</h4><p><br />
Ampersand's do not validate, so when called dynamically through a database or AJAX, make sure you call ampersands correctly! not <strong>&amp;amp;</strong> but an <strong>&amp;amp;</strong> followed by <strong>amp;</strong><br />
<br />
This should apply everywhere, be it content, links, titles or even meta data.<br />
<br />
</p><h4>Summary</h4><p><br />
That's all I've got for now, but hopefully I can part with some more words of wisdom in the future. The tips I've posted above should help to make your code validate first time, rather than having to go back and tidy up little things at the end.</p>
	              ]]></description>
	              <pubDate>Sat, 4 Oct 2008 13:53:49</pubDate>
	            </item>
		    <item>
                      <title>del and ins HTML tags</title>
	              <link>http://blog.charanj.it/post/78/del-and-ins-html-tags</link>
	              <description><![CDATA[
	              <p>When validating my HTML code, I'm sometimes presented with an error which contains the following text:<br />
<br />
</p><div class="pre quote"><p><strong>document type does not allow element "a" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag</strong></p></div><p><br />
<br />
I know what all the tags it suggest are, except for the 'del' and 'ins' tags. Turns out that they are indeed very useful and overcome a redundant and annoying bit of BBCode script I had to write myself.<br />
<br />
The del tag signals that the text it contains has been deleted, while the ins tag signifies that new text has been inserted.<br />
<br />
I am currently doing something similar with BBCode, which wraps text in a span and adds a strike through attribute. I think I'll be replacing this to just display a del tag instead, although I am not 100% sure if this purely presentational and should be left as is, or if the del tag provides more important information for bots/spiders.</p>
	              ]]></description>
	              <pubDate>Mon, 8 Sep 2008 12:18:25</pubDate>
	            </item>
		    <item>
                      <title>Nike+ blog feature</title>
	              <link>http://blog.charanj.it/post/65/nike-blog-feature</link>
	              <description><![CDATA[
	              <p>In my quest to get a little fitter and shed a bit of weight, I got myself a <a href="/post/2/nike-sportband" onclick="window.open(this.href); return false;">Nike+ SportBand</a> which I've been using on and off for a while now.<br />
<br />
I just happened to check <a href="http://zachholman.com/past/2008/08/19/looks-and-apis" onclick="window.open(this.href); return false;">Zach Holman's blog</a> the day he changed his layout and added some Nike+ functionality. It's a great feature and one I hadn't really considered. Turns out there's a <a href="http://www.crustybugger.com/blog/?p=10" onclick="window.open(this.href); return false;">Wordpress plugin</a> and a great <a href="http://lerdorf.com/php/nikeplus.phps" onclick="window.open(this.href); return false;">PHP script</a> that gives you a decent amount of info from your Nike+ account.<br />
<br />
If I'm honest, I don't run as much as I could/should but hopefully making the info a little more public will give me a bit of a spur to take it more seriously. I decided to take a similar route to the <a href="/post/32/new_blog_layout_feature_featuring_imdbphp" onclick="window.open(this.href); return false;">Arrested Development quotes</a> I took and add a basic bit of info fed through this unofficial API.<br />
<br />
You can see my total runs, distance and last run info in my <a href="#nikeplus" onclick="window.open(this.href); return false;">Nike+ sidebar</a> area. If you need a hand with getting the API to work, feel free to leave a comment.<!--fold--><br />
<br />
Mini update... I had to remove the Flickr feed because it was causing a 500 error. Unfortunately, it was causing my portfolio site to fail too, so I've removed it for now... I am sure it was working earlier and it may be an issue on Flickr's side, so I'll re-investigate the issue in a day or too!<br />
<br />
Mini update 2... Put the Flickr feature back on this blog as a test, but not on my portfolio site just yet. If i have anymore 500 erros, then it's coming out for good!</p>
	              ]]></description>
	              <pubDate>Sun, 24 Aug 2008 22:09:07</pubDate>
	            </item>
		    <item>
                      <title>JavaScript truncation and tag removal</title>
	              <link>http://blog.charanj.it/post/63/javascript-truncation-and-tag-removal</link>
	              <description><![CDATA[
	              <p>Posted for my own reference really, as I would normally do this server side, but might be useful for anyone that happens to stumble across this page.<br />
<br />
</p><div class="pre code"><pre>function truncate(content, append, len) {
  // get the length that should be truncated
  if(!len) {
    var len = 255;
  }
  var p = content;
  // If nothing's been specified to be appended to the end of the truncation
  if(!append) {
    append = '';
  }
  if (p) {
    var trunc = p;
    // if the post is longer than the max length
    if (trunc.length &amp;gt;= len) {
    // remove images
    trunc = trunc.replace(/&amp;lt;\img[^&amp;gt;]*&amp;gt;/g,'');
    // remove flash videos
    trunc = trunc.replace(/&amp;lt;object(?:.|\s)*?&amp;lt;\/object&amp;gt;/g,'');
    // truncate the text left over
    trunc = trunc.substring(0, len);
    // find the last whole word
    trunc = trunc.replace(/\w+$/, '');
  } else {
    // remove images
    trunc = trunc.replace(/&amp;lt;\img[^&amp;gt;]*&amp;gt;/g,'');
    // remove flash videos
    trunc = trunc.replace(/&amp;lt;object(?:.|\s)*?&amp;lt;\/object&amp;gt;/g,'');
  }
  return p;
}</pre></div><p><br />
<br />
The above function will strip out image and flash video tags and then truncate the text to a specified maximum length (255 default). Once it's been truncated, it will go back to the last full word. The code isn't actually that long, I just left the comments I wrote in for convenience.<!--fold--><br />
<br />
It would be easy to add more tags, striping out formatting or script tags. My regular expressions, especially in JavaScript, are not my strong point so I'm sure there would be any easier way to do the striping out. I'm thinking something similar to the str_replace function in PHP where you can pass an array of terms to replace.<br />
<br />
Lots of the functionality was learnt on the <a href="http://webdevtips.co.uk/webdevtips/js/striptag.shtml" onclick="window.open(this.href); return false;">WebDevTips</a> website and especially using their <a href="http://www.webdevtips.co.uk/webdevtips/resources/regex.php" onclick="window.open(this.href); return false;">Regular Expressions Tester</a>.</p>
	              ]]></description>
	              <pubDate>Thu, 21 Aug 2008 11:57:01</pubDate>
	            </item>
		    <item>
                      <title>A fix for IE6's pseudo class problems</title>
	              <link>http://blog.charanj.it/post/53/a_fix_for_ie6_s_pseudo_class_problems</link>
	              <description><![CDATA[
	              <p>Alex Mauzon has come up with a great way to combat the <a href="http://www.mauzon.com?p=85" onclick="window.open(this.href); return false;">omission of the :first-child and :last-child pseudo classes in IE6</a>. Using CSS expressions, you can run a simple check for items that need to adhere to the same rules.<br />
<br />
Where you would use the following for standards compliant browsers:<br />
<br />
</p><div class="pre code"><pre>element:first-child {
  background-color: red;
}</pre></div><p><br />
<br />
For IE6, you can simply use the following to check for a previous sibling:<br />
<br />
</p><div class="pre code"><pre>element {
  background-color: expression(this.previousSibling==null?'red':'green');
}</pre></div><p><br />
<br />
The above checks for a previous sibling and where there are none, the background color is red, where there are previous siblings (every other item), the background color is green. Similarly, you can just use the following to re-create the :last-child pseudo-class:<!--fold--><br />
<br />
</p><div class="pre code"><pre>element {
  background-color: expression(this.nextSibling==null?'red':'green');
}</pre></div><p><br />
<br />
So there you are, a simple fix for some of your pseudo-class woes!<br />
<br />
I did have some trouble, but as you can see from the comments on the page, I got there in the end.<br />
<br />
Please remember, that this fix relies on JavaScript to work, and if the end user does not have JavaScript enabled, the style will be ignored. To make sure standards compliant browsers see this, just make sure you keep the pseudo-class anyway!</p>
	              ]]></description>
	              <pubDate>Thu, 7 Aug 2008 19:11:53</pubDate>
	            </item>
		    <item>
                      <title>New blog layout feature, featuring IMDBPHP</title>
	              <link>http://blog.charanj.it/post/32/new-blog-layout-feature-featuring-imdbphp</link>
	              <description><![CDATA[
	              <p><a href="http://projects.izzysoft.de/trac/imdbphp/" onclick="window.open(this.href); return false;">IMDBPHP</a> is a wonderful bit of PHP that delves deep into the world of <a href="http://www.imdb.com" onclick="window.open(this.href); return false;">IMDB</a>.<br />
<br />
As you may know, I am a big fan of Arrested Development, and really wanted to feature a quote script from <a href="http://www.bluthfamily.com" onclick="window.open(this.href); return false;">bluthfamily.com</a> but the resulting layout didn't really fit into the layout of my own blog.<br />
<br />
I did write to the author/owner of bluthfamily.com, but as soon as I pressed send, I wondered if there was an IMDB API. It turns out there isn't, but IMDBPHP does exactly what I wanted.<!--fold--><br />
<br />
With the quotes returned in an array, I was able to randomly select a quote and display it to screen. What's more, I spent a bit of time playing with the rand function and got it to randomly pick one of three programs (Arrested Development, the Office and The Smoking Room) and then select a random quote.<br />
<br />
The documentation isn't great, but the <a href="http://projects.izzysoft.de/trac/imdbphp/wiki/MovieDetails" onclick="window.open(this.href); return false;">movie details</a> page gives you the best example of how to get going.<br />
<br />
You can see the result of my work just below the list of external links in the sidebar. <!--If you'd like to see the script behind my random quote generator, take a look at the <a href="http://charanj.it/examples" onclick="window.open(this.href); return false;">examples section</a> of my portfolio website, where I will soon be adding more examples for reference purposes.--><br />
<br />
Sorry for any bad language!<br />
</p>
	              ]]></description>
	              <pubDate>Sun, 13 Jul 2008 03:22:22</pubDate>
	            </item>
		    <item>
                      <title>setAttribute workaround for IE</title>
	              <link>http://blog.charanj.it/post/31/setattribute-workaround-for-ie</link>
	              <description><![CDATA[
	              <p>Another beautiful quirk in Internet Explorer is it's poor implementation of the setAttribute method. It's something I tried to make use of for my custom 'lightbox', but off course I had a lot of trouble getting it working.<br />
<br />
After a bit of searching I came across a <a href="http://www.webmasterworld.com/forum91/5025.htm" onclick="window.open(this.href); return false;">fix at webmasterworld.com</a>. Using the setAttribute method should allow you to apply a class, an id, an event or any other attribute to an element. From what I've read, IE does this to some extent. It does apply the attribute you request, but not to the HTML element, it instead applies it to the JavaScript reference to the HTML element.<br />
<br />
A subtle difference in definition, but another subtle difference that can add hours to your development time!<!--fold--><br />
<br />
Whereas compliant browsers would use:<br />
<br />
</p><div class="pre code"><pre>element.setAttribute('onclick','event();')</pre></div><p><br />
<br />
IE needs the following:<br />
<br />
</p><div class="pre code"><pre>element.onclick = eventCaller;

function eventCaller() {
  event();
}</pre></div><p><br />
<br />
Once I had the above working, I was confident that I could work around this so that the eventCaller function wasn't necessary, but it seems that it is.<br />
<br />
For other attributes, such as the class name, you'll need the following:<br />
<br />
</p><div class="pre code"><pre>element.className = 'class-name';</pre></div><p><br />
<br />
Styles work in a different way and it makes sense not to use the setAttribute method, but it would be nice to have the option to apply all your styles just once, rather than creating a new reference for every single one.<br />
<br />
Microsoft promises that IE8 will be the most compliant version, but I sincerely hope that their claims don't just apply to CSS and the DOM, but to the JavaScript API and JavaScript methods too.<br />
</p>
	              ]]></description>
	              <pubDate>Thu, 10 Jul 2008 02:01:08</pubDate>
	            </item>
		    <item>
                      <title>PHP includes and requires</title>
	              <link>http://blog.charanj.it/post/30/php-includes-and-requires</link>
	              <description><![CDATA[
	              <p>This is really here for my own benefit, but maybe it will help you to remember the differences between the include and require functions in PHP.<br />
<br />
The names are descriptive, but I would assume that a lot of people don't really give their naming much thought or even know what the differences are.<br />
<br />
The <em>include</em> functions include a file that your request. The file that you request may not exist at the path you've specified, but this won't necessarily fail your document.<br />
<br />
The <em>require</em> functions, literally requires the file you've asked for. If this file is not found, the document will stop loading and processing where it is.<br />
<br />
The require functions are what I use most of the time, they help to ensure that your code is up to scratch and nothing, no matter how small or insignificant it may be, is missing.<br />
<br />
Both of these functions are have two variations, include and include once or require and require_once.<br />
<br />
The '_once' part of the function name basically limits the file to being loaded just once, whereas using just include or require, you could load the same file again and again and again, at various places throughout the document.<!--fold--><br />
<br />
<a href="http://www.php.net" onclick="window.open(this.href); return false;">PHP.net</a> has great documentation and the user contributed examples are generally quite good for trying to get your head around things.</p>
	              ]]></description>
	              <pubDate>Mon, 7 Jul 2008 03:13:35</pubDate>
	            </item>
		    <item>
                      <title>3 pixel bug (IE6)</title>
	              <link>http://blog.charanj.it/post/24/3-pixel-bug-ie6-</link>
	              <description><![CDATA[
	              <p>Internet Explorer 6 is possibly <em>the</em> single biggest pain in my life. I can cope with anything else that's thrown at me, but development time being doubled, if not tripled, because of IE6 is just something that really tests my love of web development.<br />
<br />
I deliberately didn't develop for IE6 when building this blogging platform because I feel that I have a responsibility to promote better browsing. As a web developer, I do understand the need for backwards compatibility, but when a new version is released, it should be embraced. Plus, it's a <strong>FREE</strong> upgrade, whether you go from IE6 to 7, to Firefox, Opera or even Safari! The fact that so many people still use IE6 is a bit of a joke. It's around 10 years old, has well known security issues, is poor at doing what it's supposed to do and just simply doesn't work!<br />
<br />
Forget the box model issues, forget the JavaScript issues and the lack of support for PNGs and even the ridiculous reliance on ActiveX controls, the 3 pixel bug is possibly the dumbest and most annoying thing that IE has in it's code. These 3 pixels that can quite simply ruin a perfect layout. 3 pixels that go unnoticed with dummy content throughout development and testing, but surface as concerns from clients when real content is introduced.<br />
<br />
There are some 'accepted' fixes, but I seem to have stumbled across another!<!--fold--><br />
<br />
</p><div class="pre code"><pre>height: 1%</pre></div><p><br />
<br />
Adding the above to a floated element somehow fixes <em>some</em> issues, while in other instances it does nothing at all. This is the fix I've come across most in my travels, but it has only worked in maybe 25% of instances that I've needed to use it.<br />
<br />
The fix I've come across has worked in the few instances I've given it a go in. I've even left the original styles on the element and just added my fix to an IE6 specific stylesheet.<br />
<br />
</p><div class="pre code"><pre>display: inline;</pre></div><p><br />
<br />
That's it. Well, almost. This fixes a few issues but in some ways creates others. With a float, other items will adapt around it by filling the space that's left. When using the above fix, any other elements that <em>should</em> be on the same line will tend to wrap round. The fix for this is to apply the same fix. If you put these all into a containing div, that doesn't need to have any of it's own styles, or may even exist, it will wrap around perfectly, from top to bottom.<br />
<br />
The first issue this creates is that all the elements with the inline attribute will all be vertically aligned to the bottom of the tallest one. This can be fixed with the following applied to all affected elements:<br />
<br />
</p><div class="pre code"><pre>vertical-align: top;</pre></div><p><br />
<br />
One of the issues this inline fix fixes is that margins will no longer double in IE6 as they can when you float an element. The biggest plus for this 'hack' is that it completely avoids the 3pixel bug and will hopefully that will just mean fewer IE6 specific styles.<br />
<br />
Please remember that the fixes should be IE specific, whether you <a href="/post/16/some_dirty_hacks_for_a_couple_of_my_favourite_browsers_" onclick="window.open(this.href); return false;">hack that</a> or use a conditional comment to create an IE6 stylesheet, Firefox will completely ignore a whole bunch of any styles you set (width most importantly) if you use the inline attribute.<br />
<br />
I mainly posted this for my own reference, but please do leave a comment and let me know if it works for you!<br />
</p>
	              ]]></description>
	              <pubDate>Thu, 26 Jun 2008 04:44:08</pubDate>
	            </item>
		    <item>
                      <title>The free iPhone SDK</title>
	              <link>http://blog.charanj.it/post/23/the-free-iphone-sdk</link>
	              <description><![CDATA[
	              <p>Apple's development kit for the iPhone is pretty impressive. What is 1.2Gb worth of a disk image soon installs to reveal a wealth of tools that can be used to create applications on your iPhone. I assume these tools can also be used on your iPod Touch, but the iPhone's been such a huge success, it's not mentioned in many places.<br />
<br />
I saw the <a href="http://www.apple.com/quicktime/qtv/wwdc08/" onclick="window.open(this.href); return false;">keynote speech</a> that really showcased the SDK featuring a large number of developers showcasing their tools. One of the speakers was an Apple employee who headed the development of the SDK and he was able to show off some simple application builds on stage and then demo them on screen.<br />
<br />
This prompted me to take another look at the iPhone's SDK and I suddenly noticed the free version. I downloaded it to have a play and was mightily impressed. The interface building tools are impressive and very easy to use. I have yet to really get stuck in but I look forward to it.<br />
<br />
<img src="/uploads/iphoneemulator.jpg" alt="image" /><br />
<br />
The above screenshot was from the iPhone Simulator application that is part of the SDK. It faithfully reproduces the iPhone interface and allows you to test out your applications. It also has a basic version of the multi-touch surface, accessed by holding the option key, but it seems to only be good for zooming in and out, as I haven't been able to rotate with finger gestures so far!<!--fold--><br />
<br />
On my earlier point about the iPod Touch, this is my most likely entry into the market because I don't have the need for an iPhone, but the iPod interface on the iPhone is a must have for me. The interface is also proving to be an up and coming development environment and Apple are increasingly making it a more and more important branch of their business.<br />
<br />
If I'm able to develop anything of note for the iPhone/iPod Touch, I'll be sure to post up some sreenshots of how I went about it.<br />
</p>
	              ]]></description>
	              <pubDate>Thu, 26 Jun 2008 03:57:15</pubDate>
	            </item>
		    <item>
                      <title>Some 'dirty' hacks for a couple of my 'favourite' browsers!</title>
	              <link>http://blog.charanj.it/post/16/some-dirty-hacks-for-a-couple-of-my-favourite-browsers-</link>
	              <description><![CDATA[
	              <p>As a follow up to my previous post on <a href="/post/12/ie6_no_more_for_me_at_least_" onclick="window.open(this.href); return false;">stopping development for IE6</a>, I thought I'd share my knowledge of all the 'dirty' hacks that I'd picked up for IE6 and IE7.<br />
<br />
They're not really 'dirty', but they're not always considered to be the best method because they cause your CSS to fail validation. For me however, they're just as effective as the conditional comment that people use to exploit IE's 6 &amp;amp; 7 to behave in the way they like.<br />
<br />
I have used them many times, but have recently tried to switch to the conditional comment method. I do use them during development though, because I can just dump them into the CSS and HTML through the Firebug toolbar and I don't have to constantly switch between stylesheets<!--fold-->.<br />
<br />
There are two for IE7, but I'll just be using the one I've made use of more often because you generally use it to reset what IE6 gets wrong! I may highlight the other method in the future for reference purposes.<br />
<br />
The code below shows how you would float an element and add a 100px margin to the left.<br />
<br />
</p><div class="pre code"><pre>
div {
  float: left;
  margin: 0 0 0 100px;
}
</pre></div><p><br />
<br />
A problem with floats is that IE6 doubles margins ([among other things!), and it's a pain to get right when you have values that don't divide equally into two!<br />
<br />
</p><div class="pre code"><pre>
div {
  float: left;
  margin: 0 0 0 100px;
  _margin: 0 0 0 50px;
}
</pre></div><p><br />
<br />
This would half the margin in IE6, which then doubles it giving you the correct value. The problem with this is that IE7 still reads this hack. Annoying. However, there are two ways to reset what you've just done. One way requires a new block of code, which just bloats things even more. The other, the one illustrated bellow actually mimics the IE6 hack, but only IE7 can read it!<br />
<br />
</p><div class="pre code"><pre>
div {
  float: left;
  margin: 0 0 0 100px;
  _margin: 0 0 0 50px;
  *margin: 0 0 0 100px;
}
</pre></div><p><br />
<br />
The first margin is for all browsers, IE6 and 7 both read the second margin value, but then we make sure IE7 gets the value it really needs with the third one. This is three times the code we SHOULD need, but with the conditional comments, we'd be creating more files and more code because we'd have to re-define the selectors, so for the odd hack it's not so bad when it comes to development.<br />
<br />
If you're finding that you've got more than 10 or 20 lines of hacks, it's probably better to organize them into a file on their own. The only drawback to this method is that your CSS won't validate, but as I suggested, keeping it either separate or after your real CSS, you won't run into any problems!<br />
<br />
If you know of any other hacks, please feel free to comment.</p>
	              ]]></description>
	              <pubDate>Sun, 15 Jun 2008 02:06:30</pubDate>
	            </item>
		    <item>
                      <title>Bubble - a JavaScript game for your browser and iPhone</title>
	              <link>http://blog.charanj.it/post/13/bubble-a-javascript-game-for-your-browser-and-iphone</link>
	              <description><![CDATA[
	              <p>From a casual browse around the net, I found a game built in Flash which had been ported onto the iPhone. It was a simple puzzle game, but I have never been able to find it again.<br />
<br />
<img src="/uploads/bubble_game.jpg" alt="image" /><br />
<br />
From my searches to re-discover that gem, I came across <a href="http://xwuz.com/bubble/game.html" onclick="window.open(this.href); return false;">Bubble</a>, a game in a similar vein and probably more refined than the one I was looking for. what makes it even more impressive is the fact that it's all JavaScript based and seems to work flawlessly.<br />
<br />
The game doesn't seem to be bloated with lots of code, and works great in FireFox. I haven't tested it in other browsers, but I don't imagine there being many, if any, issues.<br />
<br />
The people behind Bubble have also introduced a <a href="http://xwuz.com/stack/game.html" onclick="window.open(this.href); return false;">log stacking</a> game, which isn't too shabby itself! The presentation is lovely and the use of JavaScript is truly inspiring to me. I wouldn't mind taking a crack at re-producing the Bubble game, but I very much doubt I'd ever make it as elegant and easy to use!<br />
<br />
One of the best things is the fact that it should work on a iPhone/iPod Touch because it doesn't require Flash, just a browser with JavaScript enabled. The size of the games, I'm guessing, should match the screen on these devices and would look pretty sweet.</p>
	              ]]></description>
	              <pubDate>Fri, 6 Jun 2008 05:08:31</pubDate>
	            </item>
		    <item>
                      <title>IE6 no more. For me at least!</title>
	              <link>http://blog.charanj.it/post/12/ie6-no-more-for-me-at-least-</link>
	              <description><![CDATA[
	              <p>That's it. No more. I don't have the time or patience to do it anymore.<br />
<br />
Internet Explorer 6 will no longer be developed for. Well, by me anyway. Some of my most recent projects have doubled in development time because of IE6. As a result of this wasted time, I've decided to stop and just add a bit of code to each of the new builds I do.<br />
<br />
<img src="/uploads/cc_IE6_warning.jpg" alt="image" /><br />
<br />
The above shows how it will appear. A simple bit of code that only IE6 reads and displays. It may seem 'lazy' on my part, but in almost any other industry, doubling your work load just for a shrinking demographic to make the most of your product, you'd be asked to phase it out as soon as possible<!--fold-->.<br />
<br />
I'd guess that 90% of professionals have the latest versions of the software they use in their sector, so why should their browser be any different. It may not be seen as an essential bit of software, but I'd guess that they spent more time using the internet than they even realise<!--fold-->.<br />
<br />
Considering the upgrade options are numerous and, most importantly, free, it's completely outrageous that such a large (thankfully reducing) number of people still use IE6.<br />
<br />
For my day job, I have to meet client's specifications, but as a 'freelancer' and on my personal projects, I won't develop for anything older than IE7 or Firefox 2. I will even be going as far as turning work down if the client uses an older browser!<br />
<br />
I code to an extremely high standard and most of my work translates to IE6 perfectly well. It's the nicer details that don't. CSS support is somewhere between non-existent and just plain wrong and JavaScript is seen as such a big threat that it spazzes out each time it's encountered!<br />
<br />
<em>PS. It's slightly ironic that the above screenshot meant developing and using IE6!</em></p>
	              ]]></description>
	              <pubDate>Fri, 6 Jun 2008 05:03:35</pubDate>
	            </item>
		    <item>
                      <title>Essential web development tools (for a Mac)</title>
	              <link>http://blog.charanj.it/post/10/essential-web-development-tools-for-a-mac-</link>
	              <description><![CDATA[
	              <p>I thought I'd blog a bit about web development tools, more specifically, the ones that I feel are essential for web development on a Mac. I'll be trying to cover both Tiger and Leopard versions of OS X.<br />
<br />
First up;<br />
<br />
</p><h4>Text editors</h4><p><br />
<br />
Among the most important tools you'll need for web development, unless of course you plump for using Dreamweaver. Personally, I find <a href="http://www.barebones.com/" onclick="window.open(this.href); return false;">Bare Bones</a>' selection of software to be the best. <a href="http://www.barebones.com/products/textwrangler/" onclick="window.open(this.href); return false;">Text Wrangler</a> is an awesome, free, tool and is now compatible with another piece of software that was previously only compatible with BBEdit, Bare Bones' flagship product<!--fold-->.<br />
<br />
If you can afford <a href="http://www.barebones.com/products/bbedit/" onclick="window.open(this.href); return false;">BBEdit</a>, there are plenty more features, but I've found Text Wrangler to be good enough. Having usedBBEdit previously, I do miss the odd feature, but if you haven't used it before, you'll find it to be a very reliable bit of software.<br />
<br />
It's worth checking out this video podcast from <a href="http://www.pixelcorps.tv/macbreak96" onclick="window.open(this.href); return false;">MacBreak</a> for a quick look at some alternatives and how they stack up against Text Wrangler and BBEdit.<br />
<br />
<br />
</p><h4>FTP</h4><p><br />
<br />
When it comes to FTP, getting your files online is all you really need and there are plenty of free tools around. I've personally used <a href="http://www.columbia.edu/acis/software/fugu/" onclick="window.open(this.href); return false;">Fugu</a> and found it to be very good at what it does.<br />
<br />
I personally use <a href="http://www.ftpclient.com/" onclick="window.open(this.href); return false;">VicomSoft's FTP client</a>, which previously catered for BBEdit users and allowed them to edit live files right of the server. It is now compatible with Text Wrangler and a selection of other text editors, so it's well worth a look. The interface is also really nice and straightforward.<br />
<br />
Fugu is a great free alternative, but you don't get the almost priceless integration of your favourite text editor with your FTP client!<br />
<br />
<br />
</p><h4>Graphics</h4><p><br />
<br />
For photo editing, look no further than <a href="http://www.pixelmator.com/" onclick="window.open(this.href); return false;">Pixelmator</a>. For the very basics, it does it's job fast, efficiently and very well. There are no vector capabilities and the results from using non-photo editing aspects are not always that great, but for chopping, resizing and manipulating photos quickly and easily, you can't go wrong with this!<br />
<br />
For something like Flash, unfortunately, Adobe's offering is the only one that works. For website layouts, you could give <a href="http://www.tweakersoft.com/vectordesigner/" onclick="window.open(this.href); return false;">VectorDesigner</a> a go, but there are hardly any tutorials and very little help around right now. If you've used Illustrator in the past, you shouldn't have many problems with it. Both of these programs make use of Leopard's core features andVectorDesigner has the added bonus of Flickr integration! For raster based design, Photoshop will probably be your best bet.<br />
<br />
<br />
</p><h4>Stats</h4><p><br />
<br />
<a href="http://www.google.com/analytics" onclick="window.open(this.href); return false;">Google Analytics</a> is probably one of the best web stat tools around. <a href="http://www.woopra.com/" onclick="window.open(this.href); return false;">Woopra</a> is currently in beta and showing some real promise. They were featured on <a href="http://geekbrief.tv/introducing-woopra-youre-gonna-want-it" onclick="window.open(this.href); return false;">GeekBrief.tv</a> and seemed to be very impressive. <a href="http://www.beunequaled.com" onclick="window.open(this.href); return false;">Be Unequaled</a> has too many monthly page impressions to be considered for the testing, but if you give it a go, let me know how you find it... I might actually enroll this blog into it, just to see how it works.<br />
<br />
You can't go wrong with Analytics though. Documentation, presentation and ease of use are the best from what I've seen when compared to similar services and especially in comparison with the standard web stats you normally get through your host!<br />
<br />
<br />
</p><h4>Server</h4><p><br />
<br />
As you may know, Mac OS X ships with Apache and PHP installed, but it's not the easiest thing to setup. <a href="http://www.mamp.info/" onclick="window.open(this.href); return false;">MAMP</a> solves that problem with ridiculous ease. As well as MySQL,PHPMyAdmin and various other features come standard. Oh and it's free! There is a paid version, but I haven't had the need for it just yet. It allows you to share local development work outside of your desktop or laptop. A very nice feature indeed.<br />
<br />
<br />
</p><h4>Resources</h4><p><br />
<br />
There are so many resources out there, and you can generally find what you need from a simple Google search. For specific results, try some of these bad boys:<br />
<br />
PSDtutes<br />
Good-Tutorials<br />
PHP.net<br />
Sitepoint<br />
Alistappart<br />
Flashkit<br />
<br />
Check back as I intend to update the list with any suggestions I recieve or with any sites I might come across on my travels!</p>
	              ]]></description>
	              <pubDate>Wed, 4 Jun 2008 04:09:14</pubDate>
	            </item>
		    <item>
                      <title>The beginning</title>
	              <link>http://blog.charanj.it/post/1/the-beginning</link>
	              <description><![CDATA[
	              <p>After some time using a blogging platform to keep the content fresh on a few of my personal projects, I finally decided to setup my own blog to let the world know about my thoughts.<br />
<br />
I made a decision early on to build my own blogging platform, giving me a chance to really put my all into making something that I may be able to pass on to any friends or family that require a simple setup. I also thought it would also be a very good opportunity to get stuck into some OOP (PHP5) as well as some MySQL.<br />
<br />
I've worked with a number of CMS' and blogging platforms, but very few impress me. Wordpress is the only one I'd really recommend to anyone, especially after being completely underwhelmed by Joomla. I've recently come across a few companies that role out Drupal as 'their' CMS, branding and modding to their customers needs, but for me that wasn't an option.<br />
<br />
At the end of the day, this is a personal project that may evolve into something more, but there's a very real possibility that in two years time I may actually be the only person using the system I've built! I made the bold decision to build just for my needs, but to also leave enough scope to allow for future expansion.<br />
<br />
</p><h4>From the beginning</h4><p><br />
<br />
After spending some time planning my database structure, I wanted to make a decision early on about how content would be entered. I've got some experience in working with the TinyMCE WYSIWYG, but I'm not a big fan of the tools in general. TinyMCE can actually be very simple with the most basic options, or it can be scaled up to include a large number of features. The basic version appealed to me, but I prefer to write in code so that I have complete control over how the content I produce is formatted.<br />
<br />
I decided that the first build of the CMS would feature a text area with some custom BBCode functionality, but for others that may take up my 'system', I'd give them the option for using the WYSIWYG, which should be a fairly painless changeover. Ultimately, I'd like that to be configurable as it is in Wordpress' admin area, but that's something for the future.<!--fold--><br />
<br />
The BBCode functionality was something that required a lot more work than I'd hoped because I wanted to be able to control the HTML wherever possible, while also having a code view. This meant abandoning the usual str_replace() function that replaces greater and less than symbols in the markup for most of the content. After quite a few hours, I stumbled across the answer and it's made BBCode even better! I'll be posting my version of BBCode in the future, so keep an eye out for it!<br />
<br />
</p><h4>Admin</h4><p><br />
<br />
The look of the admin section was a very important aspect of the blog. Wordpress has set a high standard in my eyes and although I wanted to replicate their ease of use, I didn't want to copy what had already been done. It was important because I intended for it to be the only piece that was guaranteed to be copied again and again, whereas the front end could be built in a million different ways. I also wanted my future use of the system to be as easy as possible. I have websites that are updated purely through PHPMyAdmin, but this isn't an option for something I want to take seriously.<br />
<br />
Once I had the public end of the site being fed the way I wanted it to be, I began building the admin area as just very simple pages. I wanted to give the user some continuity between the front and back end, so I've tried to use the same styles wherever possible. Once I had everything working, I went back into the display class and mixed it up a bit!<br />
<br />
Off course, only those that use the blog for their own sites will know how it looks and how well it works!<br />
<br />
</p><h4>Client side</h4><p><br />
<br />
The visitors end of the site was also something I wanted to make a really show piece on my personal blog. I wanted it to be feature rich, but simple and intuitive. Hopefully I've achieved that, but if I haven't, please do tell me where I've gone wrong! I've kept the overall theme as minimal as possible, with graphics and icons only added to make certain things stand out more.<br />
<br />
Getting features like the tag clouds, categories and the pagination working wasn't as painful as it has been in the past. I guess practice has made it easier for me to get things done. Tag clouds were new to me, on the build front, but with a bit of thought and planning it went very well. I'd even suggest it went a LOT better than I had expected, considering it worked first time!<br />
<br />
I decided to put in features that be useful for the user but also for future products, the pick of which were the tag cloud, categorisation, tagging, related topics (by tag relevance). The related topics feature was among the most difficult, but I managed to minimize the processing by getting a MySQL query do most of the work.<br />
<br />
Being a fan of the open source community, but wanting to cover my own intellectual property, I decided to put mark my posts as being part of the Creative Commons license (see bottom of this page). I have a comment listing a few details with links to the correct documentation that applies to the license I would enforce.<br />
<br />
</p><h4>JavaScript &amp;amp; Ajax</h4><p><br />
<br />
I REALLY wanted to showcase my JavaScript skills, but I like to build degradable features. With that in mind, I found it difficult to come up with something that would really benefit the site enough to be included. I decided against using any frameworks so that I could get stuck in. I know for sure that what I have isn't coded as elegantly or as simply as it possibly could be, but it's built to the best of my ability and at the time of writing, the JavaScript file is just 4kb!<br />
<br />
The first bit of JS that made it in was a simple image re-sizer. In the event that I link to external images, or am just too lazy to re-size an image in the first place, all images are dynamically given a CSS style the changes their width to match the width of the main content. I've used this on the <a href="http://www.beunequaled.com" onclick="window.open(this.href); return false;">Be Unequaled blog</a> and it was a feature that I first, inadvertently, installed on the <a href="http://www.billionaire-boys-club.co.uk/forum" onclick="window.open(this.href); return false;">Billionaire-Boys-Club.co.uk forum</a>. It's a very useful tool that keeps content nicely formatted. This off course doesn't really degrade as such, BUT it doesn't add anything that will be missed if you haven't got JavaScript enabled.<br />
<br />
The second feature was the ability to click on these re-sized images and view them in a light-box. Again, a simple feature, just not one that is available to those without JavaScript. I ended up making a custom script that just works so nicely. If an image is a link, regardless of size, it stays a link and doesn't show a light-box. Also, any images that would popup in a window larger than the available screen space would actually cause a few scrolling problems. I over came this by disabling the light-box feature, but making this image open in a new window. Not as elegant as a light-box, but certainly better than having a window that doesn't go anywhere. The light-box was completely custom made and I'm really proud of it and I've tried to make it as flexible as possible.<br />
<br />
The first Ajax feature was allowing dynamic commenting. This was just a piece of work I had to re-think and re-hash some code from a similar feature on a <a href="http://www.dpmhi.com" onclick="window.open(this.href); return false;">previous project</a>. This had to be degradable, so it works with and without JavaScript, but with it, it's just so much more fancy!<br />
<br />
</p><h4>Accessibility and SEO</h4><p><br />
<br />
I find that many of the issues raised through trying to make an accessible website apply to SEO. Correctly ordered tags, good markup and descriptive meta data, link text and well structured content usually end up ticking both boxes. SEO isn't my favourite thing because many people seem to be under the impression it can (read should!) be improved (read cheated).]<br />
<br />
I always go by the mantra that good content will get you where you deserve to be. Not that I'm an expert at writing good content, but I hope to be descriptive and interesting enough to command a place I deserve. Whether that's first, last or anywhere in between, that's purely up to Google to decide!<br />
<br />
</p><h4>W3</h4><p><br />
<br />
For many years I've followed the W3 specs and coded to a XMHTL strict standard. I have continued to for this blogging platform and I've tried to make the content delivered dynamically adhere to this specification too. If you find any pages that don't, please let me know!<br />
<br />
</p><h4>Search</h4><p><br />
<br />
I have made a lot of effort in recent years to get my head around search engine friendly URLs and getting my markup into shape, so when it came to search, I initially went down a very basic tag and category only filter. After some thought and plenty of use of the blog during development, I decided a search feature might not be so bad. Specifically for finding articles I may have written to help myself! Not much use if I can't find them with ease!<br />
<br />
For this blog, I am using the URL to send the necessary information. I have, on a personal level, normally stuck to using PHP's $_POST request over the $_GET request, but for some SEO, but mainly pagination, reasons, I decided to mix it up and get stuck in with the $_GET request.<br />
<br />
The query is quite simple. I have filtered common words like 'and', 'the', 'it' and so on and so on. This was purely to stop results getting skewed when they were returned. Upon testing my queries, I found that some posts had 'the' up to 33 times, whereas others had just one or two instances. Couple this the more important terms in a search string often not reaching the dizzy heights of occurrences like the words 'the', 'and' or 'it' and it was an easy decision to make.<br />
<br />
The results that are displayed are actually gathered by finding out how common the search terms are within the content for that post. I played with the idea of searching the content, title and description, but I had to keep in mind that I knew it would double, if not triple, the SQL execution time.<br />
<br />
In the end, I thought it would be smart to search through this for the time being, as the title and meta description may be the reason someone finds my post through a search engine, so why not give them the same opportunity here? This could be something I review in a few months after looking over all the data I collect. If I personally find the server side load to be too much, I can always review it sooner.<br />
<br />
</p><h4>Comments</h4><p><br />
<br />
I really wanted to push commenting in this project. I've always wanted to allow commenting and always been a fan of it, I just never knew how to approach it. I think it adds a whole other dimension to a site, so I decided to bring it to the blog!<br />
<br />
I've shied away from using it on my own personal sites because of the threat of spam, but my curiosity won through and it's now a part of the blog! I originally planned for a password based system, but it got too complicated for a simple blog and didn't really make sense. I had too many rules and requirements that would turn me off, let alone any casual visitors that might stroll through. Hopefully what I have is enough without being too basic, as I have allowed some custom BBCode. I've also introduced Gravatars, which I think will be a nice little touch and make the comments a far more appealing part of each post.<br />
<br />
<strong>Update:</strong> After having come across a threaded comment feature on <a href="http://www.jakeandamir.com" onclick="window.open(this.href); return false;">jakeandamir.com</a>, which uses <a href="http://disqus.com" onclick="window.open(this.href); return false;">Disqus</a> (I just got that), I decided to see if I could replicate it. Initially, only available to those with JavaScript, I intend to make it available to those without too.<br />
<br />
<strong>Update 2:</strong> I got comments working without JavaScript too, which meant more work in certain areas than I thought, but wasn't too bad overall. You can now reply to comments down to a third level.<br />
<br />
</p><h4>Launch</h4><p><br />
<br />
So, here we are after a few months of continuous development. As you may be able to tell, I was blogging during this development time. At first the admin area was little more than a single page, but it's grown to cover every aspect of the blog that needed to be managed and I'm really really happy with how it's turned out.<br />
<br />
</p><h4>The future</h4><p><br />
<br />
I really do hope that my blogging platform comes in handy for others. Be it a personal or a professional project. I feel it's simple enough for me to use and expand on in the future and could well make up the foundations of future projects.<br />
<br />
Right now, I think it's doing it's job quite nicely!<br />
</p>
	              ]]></description>
	              <pubDate>Thu, 1 May 2008 07:24:26</pubDate>
	            </item>
		    </channel>
</rss>