<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Subether</title>
	
	<link>http://www.subether.co.uk/blog</link>
	<description>Android and Web Development</description>
	<lastBuildDate>Fri, 10 Feb 2012 09:23:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Subether" /><feedburner:info uri="subether" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Dual-boot Windows 7 and Ubuntu, with Virtualization!</title>
		<link>http://feedproxy.google.com/~r/Subether/~3/i9K23DaOkuQ/</link>
		<comments>http://www.subether.co.uk/blog/2012/02/dual-boot-windows-7-and-ubuntu-with-virtualization/#comments</comments>
		<pubDate>Fri, 10 Feb 2012 09:22:30 +0000</pubDate>
		<dc:creator>Gavin</dc:creator>
				<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://www.subether.co.uk/blog/?p=296</guid>
		<description><![CDATA[So, you want to dual boot Windows 7 and Ubuntu, that&#8217;s the easy part. Just install Ubuntu and follow the instructions for setting up dual boot. The more difficult part is getting VirtualBox to use your physical partition.

The easiest OS to use in VirtualBox is Ubuntu, this is due to the way Linux  [...]]]></description>
			<content:encoded><![CDATA[<p>So, you want to dual boot Windows 7 and Ubuntu, that&#8217;s the easy part. Just install Ubuntu and follow the instructions for setting up dual boot. The more difficult part is getting VirtualBox to use your physical partition.</p>
<p><span id="more-296"></span></p>
<p>The easiest OS to use in VirtualBox is Ubuntu, this is due to the way Linux uses drivers. Windows 7 will likely blue screen if you attempt to boot from your Windows 7 physical partition.</p>
<p>So, how to do this.</p>
<ol>
<li>Download and install the latest version of <a href="http://virtualbox.org">VirtualBox</a> make sure you download the 64bit edition if you use 64bit Windows 7</li>
<li>Open and administrator command prompt, click on the start button, and in search, type &#8216;cmd&#8217;, right click on cmd and click on Run as Administrator</li>
<li>cd to the install directory from VirtualBox, usually c:\program files\Oracle\VirtualBox.<br />
<strong>cd c:\program files\Oracle\VirtualBox&#8217; in the command prompt</strong></li>
<li>Now you need to figure out the right partition.<br />
<strong>VBoxManage internalcommands listpartitions -rawdisk \\.\PhysicalDrive0</strong></li>
<li>Figure out which partition is your Ubuntu one, then you can use that partition to boot from. Mine was partition 5</li>
<li>Execute the command to make your virtual hard disk<br />
<strong>VBoxManage internalcommands createrawvmdk -filename c:\path\to\file.vmdk -rawdisk \\.\PhysicalDisk0 -partitions 5 </strong></li>
<li>You can then use that hard drive in VirtualBox.</li>
<li>Start VirtualBox, <em>You must always start VirtualBox as Administrator for this to work.</em></li>
<li>Create a new machine with Ubuntu, and make sure you select 64bit if you&#8217;re using 64bit, use your newly created hard drive as your machine&#8217;s drive. Set up your machine with a bridged network adapter and at least 16Mb virtual video RAM and 2Gb of Physical RAM. Select 3D Acceleration to make OpenGL work in Unity.</li>
<li>You can now boot up your virtual machine with Ubuntu.</li>
</ol>
<img src="http://feeds.feedburner.com/~r/Subether/~4/i9K23DaOkuQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.subether.co.uk/blog/2012/02/dual-boot-windows-7-and-ubuntu-with-virtualization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.subether.co.uk/blog/2012/02/dual-boot-windows-7-and-ubuntu-with-virtualization/</feedburner:origLink></item>
		<item>
		<title>Help! My wordpress dashboard is blank!</title>
		<link>http://feedproxy.google.com/~r/Subether/~3/ggq_U2Z02AU/</link>
		<comments>http://www.subether.co.uk/blog/2011/08/help-my-wordpress-dashboard-is-blank/#comments</comments>
		<pubDate>Mon, 15 Aug 2011 10:55:13 +0000</pubDate>
		<dc:creator>Gavin</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[blank]]></category>
		<category><![CDATA[dashboard]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.subether.co.uk/blog/?p=291</guid>
		<description><![CDATA[I had this after installing a new theme. All you have to do is find your php.ini file on your server, and change the line memory_limit = 32M to memory_limit = 128M
Gosh darn it, it works!
]]></description>
			<content:encoded><![CDATA[<p>I had this after installing a new theme. All you have to do is find your php.ini file on your server, and change the line memory_limit = 32M to memory_limit = 128M</p>
<p>Gosh darn it, it works!</p>
<img src="http://feeds.feedburner.com/~r/Subether/~4/ggq_U2Z02AU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.subether.co.uk/blog/2011/08/help-my-wordpress-dashboard-is-blank/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.subether.co.uk/blog/2011/08/help-my-wordpress-dashboard-is-blank/</feedburner:origLink></item>
		<item>
		<title>Updated android apps</title>
		<link>http://feedproxy.google.com/~r/Subether/~3/gVnOktUdI_E/</link>
		<comments>http://www.subether.co.uk/blog/2011/04/updated-android-apps/#comments</comments>
		<pubDate>Thu, 14 Apr 2011 12:43:48 +0000</pubDate>
		<dc:creator>Gavin</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Android Development]]></category>

		<guid isPermaLink="false">http://www.subether.co.uk/blog/?p=288</guid>
		<description><![CDATA[I&#8217;ve now updated my android apps to not have any ads. If you want to support the development efforts, then buy the paid for version, if you don&#8217;t, you can still download the free version and use it without ads or nag screens.
Click here to go to my apps list.
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve now updated my android apps to not have any ads. If you want to support the development efforts, then buy the paid for version, if you don&#8217;t, you can still download the free version and use it without ads or nag screens.</p>
<p><a href="https://market.android.com/search?q=subether&amp;so=1&amp;c=apps" target="_blank">Click here to go to my apps list.</a></p>
<img src="http://feeds.feedburner.com/~r/Subether/~4/gVnOktUdI_E" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.subether.co.uk/blog/2011/04/updated-android-apps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.subether.co.uk/blog/2011/04/updated-android-apps/</feedburner:origLink></item>
		<item>
		<title>Technology problem checklist</title>
		<link>http://feedproxy.google.com/~r/Subether/~3/UoE-vkGbU88/</link>
		<comments>http://www.subether.co.uk/blog/2011/03/technology-problem-checklist/#comments</comments>
		<pubDate>Tue, 22 Mar 2011 23:11:34 +0000</pubDate>
		<dc:creator>Gavin</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Humor]]></category>
		<category><![CDATA[Humour]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.subether.co.uk/blog/?p=283</guid>
		<description><![CDATA[Gavin&#8217;s [technology name] Checklist.
1. Is your [technology name] on? If yes, go to 3.
2. Switch your  [technology name]  on.
3. Is it working? If yes, go to 5.
4. Turn it off. Then go to item 2.
5. Don&#8217;t fiddle with it. Enjoy your working  [technology name].
Warning: Infinite loops may occur using  [...]]]></description>
			<content:encoded><![CDATA[<p>Gavin&#8217;s [technology name] Checklist.</p>
<p>1. Is your [technology name] on? If yes, go to 3.<br />
2. Switch your  [technology name]  on.<br />
3. Is it working? If yes, go to 5.<br />
4. Turn it off. Then go to item 2.<br />
5. Don&#8217;t fiddle with it. Enjoy your working  [technology name].</p>
<p>Warning: Infinite loops may occur using this checklist.</p>
<img src="http://feeds.feedburner.com/~r/Subether/~4/UoE-vkGbU88" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.subether.co.uk/blog/2011/03/technology-problem-checklist/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.subether.co.uk/blog/2011/03/technology-problem-checklist/</feedburner:origLink></item>
		<item>
		<title>Some great reasons to start a blog for your small/medium business</title>
		<link>http://feedproxy.google.com/~r/Subether/~3/8A7NNivBaiw/</link>
		<comments>http://www.subether.co.uk/blog/2011/03/some-great-reasons-to-start-a-blog-for-your-smallmedium-business/#comments</comments>
		<pubDate>Wed, 02 Mar 2011 11:03:22 +0000</pubDate>
		<dc:creator>Gavin</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[blogging]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.subether.co.uk/blog/?p=265</guid>
		<description><![CDATA[
You run a small business, you have a website, you advertise, you do all the usual things you should to promote your business, you can take that to the next level with a blog.
Ideally you should have a blog as part of your website, off a URL on your site such as http://www.example.com/blog/ or as a  [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.subether.co.uk/blog/wp-content/uploads/2011/03/blog-post.jpg"><img src="http://www.subether.co.uk/blog/wp-content/uploads/2011/03/blog-post-150x150.jpg" alt="" title="blog-post" width="150" height="150" class="alignright size-thumbnail wp-image-277" /></a>
<p>You run a small business, you have a website, you advertise, you do all the usual things you should to promote your business, you can take that to the next level with a blog.</p>
<p>Ideally you should have a blog as part of your website, off a URL on your site such as http://www.example.com/blog/ or as a subdomain such as http://blog.example.com/ you can easily set up blogs on sites such as <a href="http://wordpress.com" target="_blank">wordpress.com</a> and <a href="http://blogger.com" target="_blank">blogger.com</a> to use your domain, so you don&#8217;t even have to host it on your web server.</p>
<div><span id="more-265"></span></div>
<p>Blogging is a great way to connect with your customers/clients, it lets you showcase your expertise in your area, and give the latest information out to your customers. It doesn&#8217;t take long, if you do start a blog, you need to update it regularly, but just half an hour a day to do a post is just fine. Make sure when you do post a blog entry, it&#8217;s relevant to your site, and keep it brief. You want to talk to your customers on your blog as if you&#8217;re talking to a friend. Answer comments if you get any, and promote your blog. Most of all you can engage your customers in a conversation, this will give you more of an idea what your customers actually want.</p>
<p><div>The main advantages of blogging:</div>
<ul>
<li>Get good relevant content on your site &#8211; good for getting high a rank in search engines.</li>
<li>Get people linking to your site &#8211; good for getting high ranks in search engines.</li>
<li>It showcases your expertise &#8211; if you can demonstrate your expertise, people trust you.</li>
<li>It shows how passionate you are about your business &#8211; you are in business, you have to be passionate about your chosen business, or you wouldn&#8217;t be doing it.</li>
</ul>
<p>
How to start a blog:</p>
<ul>
<li>Contact me &#8211; I can help you set up a blog for your business.</li>
<li>Use a free blog provider such as  <a href="http://wordpress.com" target="_blank">wordpress.com</a> or  <a href="http://blogger.com" target="_blank">blogger.com</a>.</li>
<li>Install blog software on your web host, you usually need PHP and MySQL on your hosting.</li>
</ul>
<img src="http://feeds.feedburner.com/~r/Subether/~4/8A7NNivBaiw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.subether.co.uk/blog/2011/03/some-great-reasons-to-start-a-blog-for-your-smallmedium-business/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.subether.co.uk/blog/2011/03/some-great-reasons-to-start-a-blog-for-your-smallmedium-business/</feedburner:origLink></item>
		<item>
		<title>Simple image thumbnail creator in PHP</title>
		<link>http://feedproxy.google.com/~r/Subether/~3/YaK_a6Dx5iY/</link>
		<comments>http://www.subether.co.uk/blog/2011/02/simple-image-resizer-in-php/#comments</comments>
		<pubDate>Thu, 24 Feb 2011 10:15:09 +0000</pubDate>
		<dc:creator>Gavin</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.subether.co.uk/blog/?p=261</guid>
		<description><![CDATA[This is a very simple function, but very useful for resizing JPEG images on the fly. You need to make sure GD is enabled on your PHP installation. It will resize any JPEG picture to a specified width, very handy for eCommerce sites. It will actually fit any picture into a square thumbnail of $size  [...]]]></description>
			<content:encoded><![CDATA[<p>This is a very simple function, but very useful for resizing JPEG images on the fly. You need to make sure GD is enabled on your PHP installation. It will resize any JPEG picture to a specified width, very handy for eCommerce sites. It will actually fit any picture into a square thumbnail of $size by $size.</p>
<p>usage: processImage($file,$dest,$size)</p>
<p>$file &#8211; the name of the file, use full directory name<br />
$dest &#8211; the name of the file to output<br />
$size &#8211; WIDTH of the file.</p>
<pre name='code' class='php'>
	function processImage($file,$dest,$size)
	{
		$src = imagecreatefromjpeg($file);
		/* create thumbnail */
		$thumb = imagecreatetruecolor($size,$size);
		$red = 255;	$green = 255;	$blue = 255;
		$color = imagecolorallocate( $thumb, $red, $green, $blue ); 

		/* fill with white */
		$x = 1;
		$y = 1;
		imagefill($thumb, $x, $y, $color);

		/* get image original width and height */
		$src_x = imagesx($src);
		$src_y = imagesy($src);

                /* scale to fit width of $size if image is wider than height, align vertical center */
		if($src_x>$src_y)
		{
			$ratio=$size/$src_x;
			$new_x=$size ;
			$new_y=$src_y * $ratio;
			$new_xpos=0;
			$new_ypos=($size - $new_y) / 2;
		}
		else /* scale to fit height of $size if image is higher than wide, align vertical center */
		{
			$ratio=$size/$src_y;
			$new_x=$src_x * $ratio ;
			$new_y=$size;
			$new_ypos=0;
			$new_xpos=($size - $new_x) / 2;
		}
                /* copy to new image and save */
		imagecopyresampled($thumb,$src,$new_xpos,$new_ypos,0,0,$new_x,$new_y,$src_x,$src_y);
		imagejpeg($thumb,$dest,80);
	}
</pre>
<img src="http://feeds.feedburner.com/~r/Subether/~4/YaK_a6Dx5iY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.subether.co.uk/blog/2011/02/simple-image-resizer-in-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.subether.co.uk/blog/2011/02/simple-image-resizer-in-php/</feedburner:origLink></item>
		<item>
		<title>Make debugging MySQL simple with a PHP database wrapper</title>
		<link>http://feedproxy.google.com/~r/Subether/~3/mR6Qj2GnRZU/</link>
		<comments>http://www.subether.co.uk/blog/2011/02/simple-php-mysql-database-wrapper/#comments</comments>
		<pubDate>Sun, 20 Feb 2011 10:03:13 +0000</pubDate>
		<dc:creator>Gavin</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[MySQLi]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.subether.co.uk/blog/?p=255</guid>
		<description><![CDATA[I built this simple MySQL wrapper a while back to simplify debugging MySQL code. It&#8217;s easier to write and use a wrapper that to have a load of print debugging statements. I&#8217;ve built one for both the mysql and mysqli interfaces in PHP.
PHP Wrapper for MySQL interface
PHP Wrapper for MySQLi  [...]]]></description>
			<content:encoded><![CDATA[<p>I built this simple MySQL wrapper a while back to simplify debugging MySQL code. It&#8217;s easier to write and use a wrapper that to have a load of print debugging statements. I&#8217;ve built one for both the mysql and mysqli interfaces in PHP.</p>
<h4><a href="/code/database_mysql.phps">PHP Wrapper for MySQL interface</a></h4>
<h4><a href="/code/database_mysqli.phps">PHP Wrapper for MySQLi interface</a></h4>
<p><span id="more-255"></span></p>
<p>Example usage</p>
<pre name='code' class='php'>
<?php
      include("database_mysql.php");

      //create connection to database
      $db = new database("localhost","username","password","mydatabase");

      //do a query that returns results
      $res = $db->query("SELECT something FROM tablename"); 

      //do a query that doesn't return anything
      $db->query_forget("DELETE FROM tablename WHERE something={$somethingelse}");

      //do a query that returns a single result
      $row = $db->query_single("SELECT * FROM tablename WHERE id={$anID}");

      //get last ID of previous query
      $last_id = $db->last_id();
?>
</pre>
<p>The database wrapper will also keep a track of sql queries within a log file in PATHNAME/sql_log.txt if you turn debugging on with $debug=true;</p>
<p>Hope you find this useful, I found it speeds up build time by allowing me to use the usual CRUD queries without all the error wrapping you usually need to do, and aids debugging by keeping a log of queries if you need to.</p>
<h4><a href="/code/database_mysql.phps">PHP Wrapper for MySQL interface</a></h4>
<h4><a href="/code/database_mysqli.phps">PHP Wrapper for MySQLi interface</a></h4>
<img src="http://feeds.feedburner.com/~r/Subether/~4/mR6Qj2GnRZU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.subether.co.uk/blog/2011/02/simple-php-mysql-database-wrapper/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.subether.co.uk/blog/2011/02/simple-php-mysql-database-wrapper/</feedburner:origLink></item>
		<item>
		<title>Pull XML into a table with filtering in jQuery</title>
		<link>http://feedproxy.google.com/~r/Subether/~3/rHZUwE8KvEE/</link>
		<comments>http://www.subether.co.uk/blog/2011/02/pull-xml-into-a-table-with-filtering-in-jquery/#comments</comments>
		<pubDate>Wed, 16 Feb 2011 09:04:07 +0000</pubDate>
		<dc:creator>Gavin</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.subether.co.uk/blog/?p=246</guid>
		<description><![CDATA[Now we&#8217;re getting into more complex territory, this small project pulls in data from an XML file and feeds it into a table in your page, this XML can be either a server side script, or a feed, or just a static XML file. You wouldn&#8217;t want to do this on your main site as search engine&#8217;s wouldn&#8217;t be  [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.subether.co.uk/blog/wp-content/uploads/2011/02/xmltable.jpg"><img class="alignright size-thumbnail wp-image-249" title="xmltable" src="http://www.subether.co.uk/blog/wp-content/uploads/2011/02/xmltable-150x150.jpg" alt="" width="150" height="150" /></a>Now we&#8217;re getting into more complex territory, this small project pulls in data from an XML file and feeds it into a table in your page, this XML can be either a server side script, or a feed, or just a static XML file. You wouldn&#8217;t want to do this on your main site as search engine&#8217;s wouldn&#8217;t be able to spider the table, but it&#8217;s really useful for dashboards, statistics, admin pages, etc. You can filter the XML without reloading either the XML or the page.</p>
<h4><a href="/code/xmlfiltering/" target="_blank">Example demo XML table with filtering</a></h4>
<h4><a href="/code/xmlfiltering/xmlfiltering.zip" target="_blank">Download Files (5Kb)</a></h4>
<p><span id="more-246"></span><br />
This is the XML for the table we want to display. It&#8217;s standard looking XML, and you can and should have multiple <em>item</em>s within your <em>data</em> tag. </p>
<pre class='xml' name='code'>
<data>
	<item>
		<name>Griffith Gibbs</name>
		<tel>03009 725685</tel>
		<country>UK</country>
	</item>
</data>
</pre>
<p>The HTML looks like this.</p>
<pre class='html' name='code'>
<div id="criteria"> Selection:
<input type='radio' name='select1' value="" checked="CHECKED" onChange="changeFilter(this.value);">
  ALL
<input type='radio' name="select1" value="UK" onChange="changeFilter(this.value);">
  UK
<input type='radio' name='select1' value="USA" onChange="changeFilter(this.value);">
  USA </div>
<table id='datatable' width="100%" cellpadding="7" cellspacing="1">
<tr id='tableheader'>
<th>Name</th>
<th>Telephone</th>
<th>Country</th>
</tr>
</table>
</pre>
<p>To simplify the code, we have the filters already built in the HTML using radio buttons, on the radio button change, we call a changeFilter function to change the table. Below the radio buttons you have the table itself with table headers hard coded. Of course you could build the filters and table headers from the xml, but I did it this way for simplicity.</p>
<p>The jQuery is below. We use global variables for country and data as we need to pass those into callbacks. It&#8217;s all commented, so download the example and have a look.</p>
<pre class='javascript' name='code'>
var $country="";	//globals as we have callbacks that need this data.
var $xmldata="";	

$(document).ready(function(){
	$.ajax({							//get the XML data
 		 	url: "xmlfiltering.xml",	//URL to get the data from
 		 	success: loadTable			//callback on success
	});
});

function changeFilter(ctry){
	$country=ctry;				//set global country variable to changed country
	$(".datarow").remove();		//clear table
	loadTable($xmldata);		//rebuild
}

function loadTable(data){
	$xmldata=data;					//set our global XML variable to the data from the callback for re-use later.
	$(data).find("item country:contains('"+$country+"')").parent().each(function(){ //find each row in the XML with the country we want to show.

		var $this=$(this);							//cache selector
		var $name=$this.find("name").text();		//get name
		var $tel=$this.find("tel").text();			//get telephone
		var $country=$this.find("country").text();	//get country

		$("#datatable").append("
<tr class='datarow'>
<td>"+$name+"</td>
<td>"+$tel+"</td>
<td>"+$country+"</td>
</tr>

"); //output table row
	});
	zebraStripe();
}

//function from previous tutorial with minor change to selector to zebrastripe the table.
function zebraStripe(){
	$("#datatable").each(function(){
 	var $s=0;
		$(this).find("tr").each(function(){
			var $t = $(this).children("td");
			$s++;
			if($s%2==1)
				$t.addClass("stripe");
			else
				$t.removeClass("stripe");
		});
  	});
}
</pre>
<p>Hope you found this useful. Please download the example and use it yourself if you do.</p>
<h4><a href="/code/xmlfiltering/" target="_blank">Example demo XML table with filtering</a></h4>
<h4><a href="/code/xmlfiltering/xmlfiltering.zip" target="_blank">Download Files (5Kb)</a></h4>
<img src="http://feeds.feedburner.com/~r/Subether/~4/rHZUwE8KvEE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.subether.co.uk/blog/2011/02/pull-xml-into-a-table-with-filtering-in-jquery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.subether.co.uk/blog/2011/02/pull-xml-into-a-table-with-filtering-in-jquery/</feedburner:origLink></item>
		<item>
		<title>CSS Menus with jQuery Effects</title>
		<link>http://feedproxy.google.com/~r/Subether/~3/_BY3Upj3CyQ/</link>
		<comments>http://www.subether.co.uk/blog/2011/02/css-menus-with-jquery-effects/#comments</comments>
		<pubDate>Sat, 12 Feb 2011 20:30:07 +0000</pubDate>
		<dc:creator>Gavin</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.subether.co.uk/blog/?p=242</guid>
		<description><![CDATA[This is a continuation of the previous post Pure CSS Dropdown Menus. jQuery is used only for creating neat effects when menus are rolled over.
Example CSS Menus with jQuery Effects
Download Files (4Kb)
There are some caveats, this code will most likely not work in IE6. It will however work in most  [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.subether.co.uk/blog/wp-content/uploads/2011/02/pure-css-menus.png"><img class="alignright size-thumbnail wp-image-227" title="pure-css-menus" src="http://www.subether.co.uk/blog/wp-content/uploads/2011/02/pure-css-menus-150x150.png" alt="" width="150" height="150" /></a>This is a continuation of the previous post <a href='/blog/2011/02/pure-css-drop-down-menus/' target="_blank">Pure CSS Dropdown Menus</a>. jQuery is used only for creating neat effects when menus are rolled over.</p>
<h4><a href="/code/bigmenusjquery/" target="_blank">Example CSS Menus with jQuery Effects</a></h4>
<h4><a href="/code/bigmenusjquery/bigmenusjquery.zip" target="_blank">Download Files (4Kb)</a></h4>
<p>There are some caveats, this code will most likely not work in IE6. It will however work in most modern browsers including IE7. The best idea is to download the code and see how it works.<br />
<span id="more-242"></span><br />
This uses the now standard UL and LI tags for building menus, with anchor tags for links.</p>
<pre name="code" class="html">
<ul class='bigmenu'>
<li class='firstlevel'><a href='#'>First Level</a>
<ul>
<li><a href='#'>2nd Level</a></li>
<li><a href='#'>2nd Level</a></li>
<li><a href='#'>2nd Level</a></li>
<li><a href='#'>2nd Level</a></li>
<li><a href='#'>2nd Level</a></li>
<li><a href='#'>2nd Level</a></li>
</ul>
</li>
<li class='firstlevel'><a href='#'>First Level</a>
<ul>
<li><a href='#'>2nd Level</a></li>
<li><a href='#'>2nd Level</a></li>
<li><a href='#'>2nd Level</a></li>
<li><a href='#'>2nd Level</a></li>
<li><a href='#'>2nd Level</a></li>
<li><a href='#'>2nd Level</a></li>
</ul>
</li>
<li class='firstlevel'><a href='#'>First Level</a>
<ul>
<li><a href='#'>2nd Level</a></li>
<li><a href='#'>2nd Level</a></li>
<li><a href='#'>2nd Level</a></li>
<li><a href='#'>2nd Level</a></li>
<li><a href='#'>2nd Level</a></li>
<li><a href='#'>2nd Level</a></li>
</ul>
</li>
</ul>
</pre>
<p>Here&#8217;s the CSS it has changed slightly from the older version, we&#8217;ve eliminated the :hover as we&#8217;re using jQuery for open and close effects.</p>
<pre class='css' name='code'>

.nav {
	width: 100%;
	height: 40px;
	background-color: #999;
	display: block;
}
.bigmenu {
	margin: 0px;
	padding: 0px;
	list-style: none;
}
.bigmenu li.firstlevel {
	margin: 0px;
	padding: 0px;
	float: left;
	position: relative;
	width: auto;
	margin-right: 1px;
}
.bigmenu li.firstlevel a {
	display: block;
	height: 20px;
	padding: 10px;
	background-color: #555;
	color: white;
	text-decoration: none;
}
.bigmenu li.firstlevel ul li a {
	display: block;
	height: auto;
	padding: 5px;
	background-color: #555;
	clear: both;
}
.bigmenu li.firstlevel ul li a:hover {
	background-color: #777;
}
.bigmenu ul {
	list-style: none;
	margin: 0px;
	padding: 0px;
}
.bigmenu li.firstlevel ul {
	position: absolute;
	display: none;
	top: 40px;
	left: 0px;
	min-width: 200px;
	background-color: #555;
}
</pre>
<p>And here&#8217;s the jQuery code.</p>
<pre class='javascript' name='code'>
$(document).ready(function(){
	$(".firstlevel").mouseenter(function(){
		$(this).find("ul").stop(true,true).fadeIn(200);
	});
	$(".firstlevel").mouseleave(function(){
		$(this).find("ul").stop(true,true).fadeOut(200);
	});
});
</pre>
<p>It&#8217;s very simple, when the mouse enters, we fade in, when it leaves, we fade out. The &#8216;stop(true,true)&#8217; tells jQuery to clear all current transitions, otherwise you&#8217;ll end up with multiple effects one after each other, instead of jQuery running the effect from where it should have.</p>
<p>It&#8217;s a very small amount of code, and does a great little transition effect when opening menus, this is the beauty of jQuery, you need very little code to do some effects that, while they&#8217;re not in-your-face, they are subtle effects that add a little magic and sparkle to your site which adds to the user-experience, rather than detracting from it.</p>
<h4><a href="/code/bigmenusjquery/" target="_blank">Example CSS Menus with jQuery Effects</a></h4>
<h4><a href="/code/bigmenusjquery/bigmenusjquery.zip" target="_blank">Download Files (4Kb)</a></h4>
<img src="http://feeds.feedburner.com/~r/Subether/~4/_BY3Upj3CyQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.subether.co.uk/blog/2011/02/css-menus-with-jquery-effects/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.subether.co.uk/blog/2011/02/css-menus-with-jquery-effects/</feedburner:origLink></item>
		<item>
		<title>Pure CSS drop down menus</title>
		<link>http://feedproxy.google.com/~r/Subether/~3/OeVnhMoMhwQ/</link>
		<comments>http://www.subether.co.uk/blog/2011/02/pure-css-drop-down-menus/#comments</comments>
		<pubDate>Fri, 11 Feb 2011 21:35:19 +0000</pubDate>
		<dc:creator>Gavin</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.subether.co.uk/blog/?p=225</guid>
		<description><![CDATA[Drop down menus are great if you need a more tree like structure in your menus. This version is for a 2 level navigation style menu bar with drop down lists. They can be any size, just adjust the CSS accordingly.
Example Pure CSS Drop Down Menus
Download Files (4Kb)
There are some caveats, this  [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.subether.co.uk/blog/wp-content/uploads/2011/02/pure-css-menus.png"><img class="alignright size-thumbnail wp-image-227" title="pure-css-menus" src="http://www.subether.co.uk/blog/wp-content/uploads/2011/02/pure-css-menus-150x150.png" alt="" width="150" height="150" /></a>Drop down menus are great if you need a more tree like structure in your menus. This version is for a 2 level navigation style menu bar with drop down lists. They can be any size, just adjust the CSS accordingly.</p>
<h4><a href="/code/bigmenus/" target="_blank">Example Pure CSS Drop Down Menus</a></h4>
<h4><a href="/code/bigmenus/bigmenus.zip" target="_blank">Download Files (4Kb)</a></h4>
<p>There are some caveats, this code will not work in IE6. Internet Explorer 6 does not support :hover on elements other an anchor (A) tags. It will however work in most modern browsers including IE7. The best idea is to download the code and see how it works.<br />
<span id="more-225"></span><br />
This uses the now standard UL and LI tags for building menus, with anchor tags for links.</p>
<pre name="code" class="html">
<ul class='bigmenu'>
<li class='firstlevel'><a href='#'>First Level</a>
<ul>
<li><a href='#'>2nd Level</a></li>
<li><a href='#'>2nd Level</a></li>
<li><a href='#'>2nd Level</a></li>
<li><a href='#'>2nd Level</a></li>
<li><a href='#'>2nd Level</a></li>
<li><a href='#'>2nd Level</a></li>
</ul>
</li>
<li class='firstlevel'><a href='#'>First Level</a>
<ul>
<li><a href='#'>2nd Level</a></li>
<li><a href='#'>2nd Level</a></li>
<li><a href='#'>2nd Level</a></li>
<li><a href='#'>2nd Level</a></li>
<li><a href='#'>2nd Level</a></li>
<li><a href='#'>2nd Level</a></li>
</ul>
</li>
<li class='firstlevel'><a href='#'>First Level</a>
<ul>
<li><a href='#'>2nd Level</a></li>
<li><a href='#'>2nd Level</a></li>
<li><a href='#'>2nd Level</a></li>
<li><a href='#'>2nd Level</a></li>
<li><a href='#'>2nd Level</a></li>
<li><a href='#'>2nd Level</a></li>
</ul>
</li>
</ul>
</pre>
<p>I&#8217;ll break down the CSS bit by bit.</p>
<pre class='css' name='code'>

.bigmenu {
	margin: 0px;
	padding: 0px;
	list-style: none;
}
.bigmenu li.firstlevel {
	margin: 0px;
	padding: 0px;
	float: left;
	position: relative;
	width: auto;
	margin-right: 1px;
}
.bigmenu li.firstlevel a {
	display: block;
	height: 20px;
	padding: 10px;
	background-color: #555;
	color: white;
	text-decoration: none;
}
.bigmenu ul {
	list-style: none;
	margin: 0px;
	padding: 0px;
}
</pre>
<p>The above code defines all the first level elements, and resets the styles on the UL and LI tags.</p>
<pre class='css' name='code'>
.bigmenu li.firstlevel ul li a {
	display: block;
	height: auto;
	padding: 5px;
	background-color: #555;
}
.bigmenu li.firstlevel ul li a:hover {
	display: block;
	height: auto;
	padding: 5px;
	background-color: #777;
}
.bigmenu li.firstlevel ul {
	position: absolute;
	display: none;
	top: 40px;
	left: 0px;
	min-width: 200px;
	background-color: #555;
}
.bigmenu li.firstlevel:hover ul {
	position: absolute;
	display: block;
}
</pre>
<p>The above defines the 2nd level CSS, the most important part is <em>.bigmenu li.firstlevel ul li a:hover</em> the <em>display:block</em> shows the 2nd level! This will make sure the 2nd level menu is shown when the first level is rolled over by the mouse. It&#8217;s simple, and effective. The rest is just standard styling for CSS elements, and can be changed.</p>
<h4><a href="/code/bigmenus/" target="_blank">Example Pure CSS Drop Down Menus</a></h4>
<h4><a href="/code/bigmenus/bigmenus.zip" target="_blank">Download Files (4Kb)</a></h4>
<img src="http://feeds.feedburner.com/~r/Subether/~4/OeVnhMoMhwQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.subether.co.uk/blog/2011/02/pure-css-drop-down-menus/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.subether.co.uk/blog/2011/02/pure-css-drop-down-menus/</feedburner:origLink></item>
	</channel>
</rss>

