<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>John Hunt&#039;s web log &#187; Programming</title>
	<atom:link href="http://john-hunt.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://john-hunt.com</link>
	<description>Linux, open source, development, coding, beer and other stuff</description>
	<lastBuildDate>Wed, 22 Jun 2011 23:08:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Copying mysql tables with keys / extras</title>
		<link>http://john-hunt.com/2011/06/23/copying-mysql-tables-with-keys-extras/</link>
		<comments>http://john-hunt.com/2011/06/23/copying-mysql-tables-with-keys-extras/#comments</comments>
		<pubDate>Wed, 22 Jun 2011 23:08:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[copying tables]]></category>
		<category><![CDATA[create syntax]]></category>
		<category><![CDATA[keys]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[tables]]></category>

		<guid isPermaLink="false">http://john-hunt.com/?p=286</guid>
		<description><![CDATA[A lot of sites will tell you to do this: CREATE TABLE t2 SELECT * FROM t1; Problem is that you&#8217;ll lost your auto_increment, primary key and any other indexes you have (and any other extra meta data like that.) This might not be the best solution, but hey it worked for me: CREATE TABLE [...]]]></description>
			<content:encoded><![CDATA[<p>A lot of sites will tell you to do this:</p>
<blockquote><p>CREATE TABLE t2 SELECT * FROM t1;</p></blockquote>
<p>Problem is that you&#8217;ll lost your auto_increment, primary key and any other indexes you have (and any other extra meta data like that.)</p>
<p>This might not be the best solution, but hey it worked for me:</p>
<blockquote><p>CREATE TABLE t2 LIKE t1;</p>
<p>INSERT INTO t2 SELECT * FROM t1;</p></blockquote>
<p>Hope that helps somebody.. I only noticed I&#8217;d lost all my primary keys after copying a load of tables using the old method.</p>
]]></content:encoded>
			<wfw:commentRss>http://john-hunt.com/2011/06/23/copying-mysql-tables-with-keys-extras/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Accessing get vars with ActionScript 3</title>
		<link>http://john-hunt.com/2011/05/06/accessing-get-vars-with-actionscript-3/</link>
		<comments>http://john-hunt.com/2011/05/06/accessing-get-vars-with-actionscript-3/#comments</comments>
		<pubDate>Fri, 06 May 2011 06:39:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://john-hunt.com/?p=267</guid>
		<description><![CDATA[I&#8217;ve just started to learn a bit of ActionScript for a new project I&#8217;m working on. The first thing I needed to do was integrate a message from the source html (and eventually a php file.) Turns out there&#8217;s pretty much no clear documentation out there on the web, so I decided to write this. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just started to learn a bit of ActionScript for a new project I&#8217;m working on. The first thing I needed to do was integrate a message from the source html (and eventually a php file.) Turns out there&#8217;s pretty much no clear documentation out there on the web, so I decided to write this.</p>
<p>First thing&#8217;s first, create a text object in your flash file and set the instance name to something you can easily remember, in this example I set it to message. Once you&#8217;ve done that, on the keyframe for the layer in which that peice of text is, right click it and click on actions, then add the following:</p>
<p>
<pre>this.message.text = LoaderInfo(this.root.loaderInfo).parameters.mymessage;</pre>
</p>
<p>Easy enough, now you can publish your html. Once published, remove all the javascript stuff and the &lt;noscript&gt; tags surrounding the embed code [note, there's probably a better way of doing all this and I'll update this post once I figure it out.]</p>
<p>
<pre>&lt;param name="movie" value="test.swf" /&gt;
&lt;param name="quality" value="high" /&gt;
&lt;param name="bgcolor" value="#ffffff" /&gt;
&lt;embed src="<span style="color: #ff0000;">test.swf?mymessage=workingok</span>" quality="high" bgcolor="#ffffff"
  width="600" height="450" name="test" align="middle" allowScriptAccess="sameDomain"
  allowFullScreen="false" type="application/x-shockwave-flash" 
  pluginspage="http://www.adobe.com/go/getflashplayer" /&gt;</pre>
</p>
<p>That&#8217;s basically where you set the variables you want to pass to flash. You have to urlencode each parameter. If you don&#8217;t know what that means, google it.</p>
]]></content:encoded>
			<wfw:commentRss>http://john-hunt.com/2011/05/06/accessing-get-vars-with-actionscript-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BigDump</title>
		<link>http://john-hunt.com/2011/04/06/bigdump/</link>
		<comments>http://john-hunt.com/2011/04/06/bigdump/#comments</comments>
		<pubDate>Tue, 05 Apr 2011 23:08:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://john-hunt.com/?p=259</guid>
		<description><![CDATA[Recently I&#8217;ve started having to work with sites hosted on shared hosting with phpMyAdmin and a measly 2MB upload limit for database imports. To get around this issue, I found a great little tool called bigdump which can just import a mysqldump file (even if gzipped) &#8211; just upload via ftp and import! Pretty sweet. [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve started having to work with sites hosted on shared hosting with phpMyAdmin and a measly 2MB upload limit for database imports. To get around this issue, I found a great little tool called bigdump which can just import a mysqldump file (even if gzipped) &#8211; just upload via ftp and import! Pretty sweet.</p>
<p><a href="http://www.ozerov.de/bigdump.php">http://www.ozerov.de/bigdump.php</a></p>
]]></content:encoded>
			<wfw:commentRss>http://john-hunt.com/2011/04/06/bigdump/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL 5 and old clients (like php4)</title>
		<link>http://john-hunt.com/2009/08/04/mysql-5-and-old-clients-like-php4/</link>
		<comments>http://john-hunt.com/2009/08/04/mysql-5-and-old-clients-like-php4/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 03:38:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://john-hunt.com/?p=175</guid>
		<description><![CDATA[Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in /blah/somepage.php on line 123 The reason for this warning is because PHP4 can&#8217;t communicate with a MySQL5 server unless it&#8217;s using old passwords (set by using the OLD_PASSWORD() function below.) There are two simple ways to fix this. The [...]]]></description>
			<content:encoded><![CDATA[<p><code>Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in /blah/somepage.php on line 123</code></p>
<p>The reason for this warning is because PHP4 can&#8217;t communicate with a MySQL5 server unless it&#8217;s using old passwords (set by using the OLD_PASSWORD() function below.)</p>
<p>There are two simple ways to fix this. The first would be to upgrade your version of php. Unless you *really* need php4 (or below?!) upgrade! I&#8217;m not sure php4 is supported any more and should be considered a security risk. If you can&#8217;t upgrade, just do this in your database:</p>
<p><code>update mysql.user set password=OLD_PASSWORD('thepassword') where user = 'theusername';</code><br />
and:<br />
<code>flush privileges;</code></p>
<p>This should do the trick. Be warned, if you issue any GRANT statements after this you will have to update mysql.user again.</p>
]]></content:encoded>
			<wfw:commentRss>http://john-hunt.com/2009/08/04/mysql-5-and-old-clients-like-php4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Auto_increment fun!</title>
		<link>http://john-hunt.com/2009/07/14/auto_increment-fun/</link>
		<comments>http://john-hunt.com/2009/07/14/auto_increment-fun/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 07:50:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://john-hunt.com/?p=166</guid>
		<description><![CDATA[Discovered some fun things in MySQL today.. Set the variable @id to 0: SET @id = 0; Update the column id to be id + 1 &#8211; this will re-index your id column in one fell swoop. Very nice: UPDATE tblname SET id = (@id := @id + 1); Set the first value for an [...]]]></description>
			<content:encoded><![CDATA[<p>Discovered some fun things in MySQL today..</p>
<p>Set the variable @id to 0:<br />
<code>SET @id = 0;</code></p>
<p>Update the column id to be id + 1 &#8211; this will re-index your id column in one fell swoop. Very nice:<br />
<code>UPDATE tblname SET id = (@id := @id + 1);</code></p>
<p>Set the first value for an auto_increment column:<br />
<code>ALTER TABLE tblname AUTO_INCREMENT = 196;</code><br />
(this won&#8217;t work if there are rows with a higher value already in the table)</p>
<p>All in all, a few nice bits and pieces for cleaning up your tables.</p>
]]></content:encoded>
			<wfw:commentRss>http://john-hunt.com/2009/07/14/auto_increment-fun/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP-Clearsilver installation guide for Ubuntu/Debian</title>
		<link>http://john-hunt.com/2008/03/27/php-clearsilver-installation-guide-for-ubuntudebian/</link>
		<comments>http://john-hunt.com/2008/03/27/php-clearsilver-installation-guide-for-ubuntudebian/#comments</comments>
		<pubDate>Thu, 27 Mar 2008 06:39:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[clearsilver]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[templating]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://john-hunt.com/linux/2008/03/27/php-clearsilver-installation-guide-for-ubuntudebian/</guid>
		<description><![CDATA[I updated my php-clearsilver installation guide today after discovering it&#8217;s wrong in a few places. Fortunately, I don&#8217;t think anyone&#8217;s ever used it (apart from me today.) If you know what clearsilver is and you use php, you might find it interesting. Installing PHP Clearsilver module for apache on Ubuntu and Debian]]></description>
			<content:encoded><![CDATA[<p>I updated my php-clearsilver installation guide today after discovering it&#8217;s wrong in a few places. Fortunately, I don&#8217;t think anyone&#8217;s ever used it (apart from me today.)</p>
<p>If you know what clearsilver is and you use php, you might find it interesting.</p>
<p><a href="http://john-hunt.com/wiki/doku.php/clearsilver-php">Installing PHP Clearsilver module for apache on Ubuntu and Debian</a></p>
]]></content:encoded>
			<wfw:commentRss>http://john-hunt.com/2008/03/27/php-clearsilver-installation-guide-for-ubuntudebian/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Fluid horizontal list based highlighting menu with icons</title>
		<link>http://john-hunt.com/2008/02/28/fluid-horizontal-list-based-highlighting-menu-with-icons/</link>
		<comments>http://john-hunt.com/2008/02/28/fluid-horizontal-list-based-highlighting-menu-with-icons/#comments</comments>
		<pubDate>Thu, 28 Feb 2008 02:18:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[fluid]]></category>
		<category><![CDATA[horizontal]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[icons]]></category>
		<category><![CDATA[li]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[markup]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[ul]]></category>

		<guid isPermaLink="false">http://john-hunt.com/programming/2008/02/28/fluid-horizontal-list-based-highlighting-menu-with-icons/</guid>
		<description><![CDATA[No doubt it&#8217;s been done elsewhere, but I spent quite a while trying to get this one working. Basically I wanted a horizontal css menu with decent markup and no hacks. I also wanted to have nice icons for each item correctly vertically aligned. On top of that I wanted the whole thing to be [...]]]></description>
			<content:encoded><![CDATA[<p>No doubt it&#8217;s been done elsewhere, but I spent quite a while trying to get this one working. Basically I wanted a horizontal css menu with decent markup and no hacks. I also wanted to have nice icons for each item correctly vertically aligned. On top of that I wanted the whole thing to be fluid so it would look right at any text size. Unfortunately because of IE6&#8242;s lack of support for :hover on anything but links I needed to use containing spans for the text on each list item (doh!) I guess you could use javascript or something instead, but that&#8217;d be really horrid!</p>
<p>After a lot of hair pulling, I finally got it to work:<br />
<img src='http://john-hunt.com/wp-content/uploads/2008/02/menu1.png' alt='Menu' /></p>
<pre>
#navigation ul {
  margin:               0;
  padding:              0;
  background-color:     #eee;
  height:               2em;
  border-bottom:        1px solid #888;
}

#navigation li {
  float:                left;
  list-style-type:      none;
  border-right:         1px solid #888;
}

#navigation a {
  float:                left;
  margin:               0;
  background-repeat:    no-repeat;
  background-position:  5px 50%;
  text-decoration:      none;
  color:                #333;
}

#navigation .inner {
  padding:              0 .4em 0 26px;  /* Adjust based on the width of icon + 10px */
  display:              inline;
  line-height:          2em;
  vertical-align:       middle;
}

#navigation .contacts {
  background-image: url(/crm/resources/icons/contacts.png)
}

#navigation .activities {
  background-image: url(/crm/resources/icons/activities.png)
}

#navigation .reports {
  background-image: url(/crm/resources/icons/reports.png)
}

#navigation .utilities {
  background-image: url(/crm/resources/icons/utilities.png)
}

#navigation a:hover {
  background-color:         #fff;
}</pre>
<p>And here&#8217;s the HTML:</p>
<pre>
&lt;div id="navigation"&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href="" class="contacts"&gt;&lt;span class="inner"&gt;Contacts&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="" class="activities"&gt;&lt;span class="inner"&gt;Activities&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="" class="reports"&gt;&lt;span class="inner"&gt;Reports&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="" class="utilities"&gt;&lt;span class="inner"&gt;Utilities&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;/div&gt;
</pre>
<p>*I got my icons from the fantastic <a href="http://www.famfamfam.com">FamFamFam</a> web site. This guy gives away loads of great icons for free. You might want to convert them to transparent gifs though as obviously IE6- won&#8217;t handle the transparency in the PNGs.</p>
<p>I&#8217;m no css expert, so if you can see anything silly in the css/markup or know of some way of improving this, please drop me a comment!</p>
]]></content:encoded>
			<wfw:commentRss>http://john-hunt.com/2008/02/28/fluid-horizontal-list-based-highlighting-menu-with-icons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

