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

<channel>
	<title>dragffy.com</title>
	<atom:link href="http://dragffy.com/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://dragffy.com/blog</link>
	<description>The development, documentation, and blogging domain of Gabriel Dragffy.</description>
	<pubDate>Wed, 03 Dec 2008 19:43:34 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.5</generator>
	<language>en</language>
			<item>
		<title>Beware of the Trailing Comma in JavaScript Prototypes</title>
		<link>http://dragffy.com/blog/posts/beware-of-the-trailing-comma-in-javascript-prototypes</link>
		<comments>http://dragffy.com/blog/posts/beware-of-the-trailing-comma-in-javascript-prototypes#comments</comments>
		<pubDate>Wed, 03 Dec 2008 11:29:12 +0000</pubDate>
		<dc:creator>Gabe</dc:creator>
		
		<category><![CDATA[Books]]></category>

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

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

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

		<category><![CDATA[Operating System]]></category>

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

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

		<guid isPermaLink="false">http://dragffy.com/blog/?p=66</guid>
		<description><![CDATA[Came accross the following post at:
http://www.pluralsight.com/community/blogs/fritz/archive/2007/06/19/47771.aspx
&#8220;I spent more time than I care to admit tracking down this one, perhaps this post will save someone else the trouble&#8230;
When defining a number of functions in a prototype in JavaScript, do not include a trailing comma after the last function:

MyType.prototype = {
    foo : function() [...]]]></description>
			<content:encoded><![CDATA[<p>Came accross the following post at:<br />
<a href="http://www.pluralsight.com/community/blogs/fritz/archive/2007/06/19/47771.aspx">http://www.pluralsight.com/community/blogs/fritz/archive/2007/06/19/47771.aspx</a></p>
<p>&#8220;I spent more time than I care to admit tracking down this one, perhaps this post will save someone else the trouble&#8230;</p>
<p>When defining a number of functions in a prototype in JavaScript, do not include a trailing comma after the last function:</p>
<pre>
MyType.prototype = {
    foo : function() {
          // ...
    },

    bar : function() {
        //...
    }, //< - fails in IE!
 }
</pre>
<p>What was especially tricky about tracking this problem down was that FireFox works with or without the trailing comma, so it only fails in IE!&#8221;</pre>
]]></content:encoded>
			<wfw:commentRss>http://dragffy.com/blog/posts/beware-of-the-trailing-comma-in-javascript-prototypes/feed</wfw:commentRss>
		</item>
		<item>
		<title>IE doesn&#8217;t recognise &#8220;select option&#8221;.click()</title>
		<link>http://dragffy.com/blog/posts/ie-doesnt-recognise-select-optionclick</link>
		<comments>http://dragffy.com/blog/posts/ie-doesnt-recognise-select-optionclick#comments</comments>
		<pubDate>Fri, 14 Nov 2008 14:30:14 +0000</pubDate>
		<dc:creator>Gabe</dc:creator>
		
		<category><![CDATA[Development]]></category>

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

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

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

		<guid isPermaLink="false">http://dragffy.com/blog/?p=65</guid>
		<description><![CDATA[Instead of:
        $(&#8217;#ranges option&#8217;).click(function() {
            var val = $(this).val();
            //do something with val
        });
Had to change it to:
  [...]]]></description>
			<content:encoded><![CDATA[<p>Instead of:<br />
        $(&#8217;#ranges option&#8217;).click(function() {<br />
            var val = $(this).val();<br />
            //do something with val<br />
        });</p>
<p>Had to change it to:<br />
        $(&#8217;#ranges&#8217;).change(function() {<br />
            var val = $(this).val();<br />
            //do something with val<br />
        });</p>
]]></content:encoded>
			<wfw:commentRss>http://dragffy.com/blog/posts/ie-doesnt-recognise-select-optionclick/feed</wfw:commentRss>
		</item>
		<item>
		<title>Git errors on Cygwin</title>
		<link>http://dragffy.com/blog/posts/git-errors-on-cygwin</link>
		<comments>http://dragffy.com/blog/posts/git-errors-on-cygwin#comments</comments>
		<pubDate>Tue, 16 Sep 2008 09:35:50 +0000</pubDate>
		<dc:creator>Gabe</dc:creator>
		
		<category><![CDATA[Development]]></category>

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

		<category><![CDATA[Operating System]]></category>

		<category><![CDATA[Revision Control]]></category>

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

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

		<guid isPermaLink="false">http://dragffy.com/blog/?p=64</guid>
		<description><![CDATA[I&#8217;ve recently started experimenting with Git, previously being totally committed(!) to Bazaar. Git is difficult in comparison but I intend to stick with it. I have been using Git under Cygwin on Windows XP, it seemed to work fairly well except that often when I added a large batch of source code files they wouldn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently started experimenting with Git, previously being totally committed(!) to Bazaar. Git is difficult in comparison but I intend to stick with it. I have been using Git under Cygwin on Windows XP, it seemed to work fairly well except that often when I added a large batch of source code files they wouldn&#8217;t get committed.</p>
<p>Eventually I found out it is because Git is choking on one the line endings in some files. When trying a commit of these files I would see a whole load of errors fly by such as &#8216;trailing whitespace&#8217; and &#8220;you have some suspicious patch lines&#8221;. Googling around I found three answers, but I could only fully understand two of them.</p>
<p>Firstly, the approach I took, was to run the command <code>chmod a-x .git/hooks/pre-commit</code> in the git repository.</p>
<p>The other approach, which I found <a href="http://www.dont-panic.cc/capi/2007/07/13/git-on-windows-you-have-some-suspicious-patch-lines/">here</a> says to edit the pre-commit file above and comment out the lines:<br />
<code>if (/\s$/) {<br />
bad_line("trailing whitespace", $_);<br />
}</code></p>
<p>Which would mean changing it to:<br />
<code>#if (/\s$/) {<br />
#bad_line("trailing whitespace", $_);<br />
#}</code></p>
<p>Hope that can help someone!</p>
]]></content:encoded>
			<wfw:commentRss>http://dragffy.com/blog/posts/git-errors-on-cygwin/feed</wfw:commentRss>
		</item>
		<item>
		<title>Firefox 3 - OS X Memory Hog</title>
		<link>http://dragffy.com/blog/posts/firefox-3-os-x-memory-hog</link>
		<comments>http://dragffy.com/blog/posts/firefox-3-os-x-memory-hog#comments</comments>
		<pubDate>Fri, 18 Jul 2008 14:55:00 +0000</pubDate>
		<dc:creator>Gabe</dc:creator>
		
		<category><![CDATA[Leopard]]></category>

		<category><![CDATA[OS X]]></category>

		<category><![CDATA[Firefox 3]]></category>

		<category><![CDATA[web browsers]]></category>

		<guid isPermaLink="false">http://dragffy.com/blog/?p=63</guid>
		<description><![CDATA[A good article has been written on PC Mech about Firefox 3 being a memory hog. The author got slated by some, but I support the author. From my first hand experience FF3 on OS X Leopard has managed to eat up 650MB RAM with just a few tabs open.
Full article can be found here: [...]]]></description>
			<content:encoded><![CDATA[<p>A good article has been written on PC Mech about Firefox 3 being a memory hog. The author got slated by some, but I support the author. From my first hand experience FF3 on OS X Leopard has managed to eat up 650MB RAM with just a few tabs open.</p>
<p>Full article can be found here: http://www.pcmech.com/article/firefox-3-hogs-memory-like-crazy/</p>
]]></content:encoded>
			<wfw:commentRss>http://dragffy.com/blog/posts/firefox-3-os-x-memory-hog/feed</wfw:commentRss>
		</item>
		<item>
		<title>Using Python Doctests in Django with fixtures</title>
		<link>http://dragffy.com/blog/posts/using-python-doctests-in-django-with-fixtures</link>
		<comments>http://dragffy.com/blog/posts/using-python-doctests-in-django-with-fixtures#comments</comments>
		<pubDate>Tue, 24 Jun 2008 15:28:51 +0000</pubDate>
		<dc:creator>Gabe</dc:creator>
		
		<category><![CDATA[Development]]></category>

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

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

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

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

		<category><![CDATA[web dev]]></category>

		<guid isPermaLink="false">http://dragffy.com/blog/?p=61</guid>
		<description><![CDATA[Django is a pretty decent web framework for Python. Having brushed up on my Python programming I started to fall in love with doctests. I then went ahead and wrote about 100 lines of doctest for model in Django, then found all tests were failing because the database fixtures weren&#8217;t being loaded.
I couldn&#8217;t find out [...]]]></description>
			<content:encoded><![CDATA[<p>Django is a pretty decent web framework for Python. Having brushed up on my Python programming I started to fall in love with doctests. I then went ahead and wrote about 100 lines of doctest for model in Django, then found all tests were failing because the database fixtures weren&#8217;t being loaded.</p>
<p>I couldn&#8217;t find out how to install fixtures inside doctests from the official documentation, I did however, come across what seemed like a web page written in Japanese. I had to skip the Japanese but figured out the code samples. Getting fixtures working with doctests in django is fairly simple - once you know how!</p>
<p>At the top of your doctest you will need the following two lines:<br />
<code>>>> from django.core import management<br />
>>> management.call_command("loaddata", "project/fixtures/test.json", \<br />
        verbosity=0)</code></p>
<p>Replace <code>project</code> and <code>test.json</code> with your project name and fixture. Then continue with the doctests as per usual. After they are done put the following line at the end of the doctest:<br />
<code>>>> management.call_command("flush", verbosity=0, interactive=False)</code></p>
<p>That should be just about it <img src='http://dragffy.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://dragffy.com/blog/posts/using-python-doctests-in-django-with-fixtures/feed</wfw:commentRss>
		</item>
		<item>
		<title>Eliminating crackling/distorted noise on Intel Mac computers running Ubuntu/Linux</title>
		<link>http://dragffy.com/blog/posts/eliminating-cracklingdistorted-noise-on-intel-mac-computers-running-ubuntulinux</link>
		<comments>http://dragffy.com/blog/posts/eliminating-cracklingdistorted-noise-on-intel-mac-computers-running-ubuntulinux#comments</comments>
		<pubDate>Sat, 17 May 2008 10:40:43 +0000</pubDate>
		<dc:creator>Gabe</dc:creator>
		
		<category><![CDATA[HowTo]]></category>

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

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

		<category><![CDATA[Operating System]]></category>

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

		<guid isPermaLink="false">http://dragffy.com/blog/?p=53</guid>
		<description><![CDATA[I have a first generation macbook coreduo.
The latest version of Ubuntu (Hardy Heron 8.04 LTS) works very well on it with minimal configuration. However, several issues remain. One of which is the poor sound quality. Initially, installing linux-backports-modules did the trick, however after several reboots it became clear that it didn&#8217;t always work. I came [...]]]></description>
			<content:encoded><![CDATA[<p>I have a first generation macbook coreduo.</p>
<p>The latest version of Ubuntu (Hardy Heron 8.04 LTS) works very well on it with minimal configuration. However, several issues remain. One of which is the poor sound quality. Initially, installing linux-backports-modules did the trick, however after several reboots it became clear that it didn&#8217;t always work. I came across this <a href="http://ubuntuforums.org/showpost.php?p=3764871&#038;postcount=9">post</a>, which I followed and the results were outstanding. I have completely copied it here, only to make sure there is another copy of this important document. Full credit for this one goes to the original author. Anyway, here&#8217;s what you need to do:</p>
<p>Edit the file <code>/etc/modprobe.d/options</code><br />
<code>$ sudo vim /etc/modprobe.d/options</code></p>
<p>And add the following to the end of the file:<br />
<code>options snd-hda-intel model=[MODEL_BELOW] position_fix=2 probe_mask=1</code></p>
<p>Run the following command:<br />
<code>$ sudo update-initramfs -u</code></p>
<p>Then reboot.</p>
<p>You must select the Intel HDA model that corresponds to your computer:</p>
<p>These are the codes you can use in the above instructions:<br />
<strong>intel-mac-v1</strong>   : Intel Mac Type 1<br />
<strong>intel-mac-v2</strong>   : Intel Mac Type 2<br />
<strong>intel-mac-v3</strong>   : Intel Mac Type 3<br />
<strong>intel-mac-v4</strong>   : Intel Mac Type 4<br />
<strong>intel-mac-v5</strong>   : Intel Mac Type 5<br />
<strong>macmini</strong>        : Intel Mac Mini (equivalent with type 3)<br />
<strong>macbook</strong>        : Intel Mac Book (eq. type 5)<br />
<strong>macbook-pro-v1</strong> : Intel Mac Book Pro 1st generation (eq. type 3)<br />
<strong>macbook-pro</strong>    : Intel Mac Book Pro 2nd generation (eq. type 3)<br />
<strong>imac-intel</strong>     : Intel iMac (eq. type 2)<br />
<strong>imac-intel-20</strong>  : Intel iMac (newer version) (eq. type 3)</p>
<p>For example, I have a Macbook 1st generation, and the only setting that worked was<br />
model=intel-mac-v1. All others just gave me <strong>no</strong> sound at all, including the apparently<br />
obvious macbook and the documented-as-equivalent macmini ones.</p>
<p>If nothing works, you can revert this by deleting the line and performing the rest of the steps.</p>
<p>For BEST sound, if the above works, open a terminal and type:<br />
<code>$ alsamixer</code></p>
<p>And set the <strong>front</strong> and <strong>surround</strong> sliders to their maximum.<br />
It might be necessary to unmute them with the &#8216;M&#8217; key.<br />
Press ESC twice to leave the program.</p>
]]></content:encoded>
			<wfw:commentRss>http://dragffy.com/blog/posts/eliminating-cracklingdistorted-noise-on-intel-mac-computers-running-ubuntulinux/feed</wfw:commentRss>
		</item>
		<item>
		<title>Setup a fileserver using RAID 1 &#038; 5 on Ubuntu Hardy Heron 8.04 LTS Server</title>
		<link>http://dragffy.com/blog/posts/setup-a-fileserver-using-raid-1-5-on-ubuntu-hardy-heron-804-lts-server</link>
		<comments>http://dragffy.com/blog/posts/setup-a-fileserver-using-raid-1-5-on-ubuntu-hardy-heron-804-lts-server#comments</comments>
		<pubDate>Tue, 13 May 2008 11:00:13 +0000</pubDate>
		<dc:creator>Gabe</dc:creator>
		
		<category><![CDATA[Books]]></category>

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

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

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

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

		<category><![CDATA[Operating System]]></category>

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

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

		<guid isPermaLink="false">http://dragffy.com/blog/?p=52</guid>
		<description><![CDATA[I recently set up a new file server. It contains three 1 terabyte drives configured in a RAID 5 array but with RAID 1 for the boot partitions so in the event of drive failure the system could still boot.
Essentially you need to go through a normal installation process and make sure you choose a [...]]]></description>
			<content:encoded><![CDATA[<p>I recently set up a new file server. It contains three 1 terabyte drives configured in a RAID 5 array but with RAID 1 for the boot partitions so in the event of drive failure the system could still boot.</p>
<p>Essentially you need to go through a normal installation process and make sure you choose a couple of things during parition setup. I split each of the 3 drives in to two partitions, one 200MB, and the other partition the remaining disc space. This is what I had:<br />
sda1 = 200MB<br />
sda2 = 9800MB<br />
and the same for the other drives.</p>
<p>Set all sda1 partition to be ext3 and bootable and mounted as /boot, set sdb1 and sdc1 partitions to be Linux Software Raid, bootable, but not mounted. Configure the RAID and create a new RAID device, tell it to use three devices and add to it sda2, sdb2, and sdc2.</p>
<p>When I returned to the partition menu I configured md0 as a partition for a logical volume group. I then configured LVM and created logical volumes for /root, swap, and /home. Returning to the partitioning menu I formatted these and selected their mount points and installed the system.</p>
<p>Following system installation I went about creating a RAID 1 array for sda1, sdb1, and sdc1. First thing was to create a new array using mdadm and the two paritions we haven&#8217;t yet assigned:<br />
<code># mdadm --create /dev/md1 --level=1 --raid-disks=3 missing /dev/sdb1 /dev/sdc1</code></p>
<p>Make a filesystem on our new RAID device:<br />
<code># mkfs.ext3 -m 0 /dev/md1</code></p>
<p>Save the new configuration in to mdadm&#8217;s config file:<br />
<code># mdadm --examine --scan >> /etc/mdadm/mdadm.conf</code></p>
<p>Edit mdadm.conf and remove the duplicate entry at the bottom:<br />
<code># vim /etc/mdadm.conf</code></p>
<p>Mount the new RAID device so we can copy data to it:<br />
<code># mkdir /media/md1</code><br />
<code># mount /dev/md1 /media/md1</code></p>
<p>Copy over the boot partition to the RAID device:<br />
<code># cd /boot</code><br />
<code># cp -dpRx . /media/md1</code></p>
<p>Edit fstab and replace /dev/sda1 with /dev/md1:<br />
<code># vim /etc/fstab</code></p>
<p>Edit mtab and do the same:<br />
<code># vim /etc/mtab</code></p>
<p>Unmount /boot, change it&#8217;s system type and add it to the RAID array:<br />
<code># umount /boot</code><br />
<code># fdisk /dev/sda</code><br />
<code><strong>Command (m for help):</strong> t</code><br />
<code><strong>Partition number (1-4):</strong> 1</code><br />
<code><strong>Hex code (type L to list codes):</strong> f</code><br />
<code><strong>Changed system type of partition 1 to fd (Linux raid autodetect)</strong></code><br />
<code><strong>Command (m for help):</strong> w</code></p>
<p><code># mdadm --add /dev/md1 /dev/sda1</code></p>
<p>Configure GRUB so that it can boot from any hard drive:<br />
<code># grub</code><br />
<strong>grub></strong> device (hd0) /dev/sda<br />
<strong>grub></strong> root (hd0,0)<br />
<strong>grub></strong> setup (hd0)<br />
<strong>grub></strong> device (hd0) /dev/sdb<br />
<strong>grub></strong> root (hd0,0)<br />
<strong>grub></strong> setup (hd0)<br />
<strong>grub></strong> device (hd0) /dev/sdc<br />
<strong>grub></strong> root (hd0,0)<br />
<strong>grub></strong> setup (hd0)<br />
<strong>grub></strong> quit</p>
<p><code># update-initramfs -u</code></p>
<p>Change all occurance of (hd*) to (hd0) in the file <code>/boot/grub/devices.map</code>.</p>
<p>That should be all - good luck with the reboot!<br />
<code># reboot</code></p>
]]></content:encoded>
			<wfw:commentRss>http://dragffy.com/blog/posts/setup-a-fileserver-using-raid-1-5-on-ubuntu-hardy-heron-804-lts-server/feed</wfw:commentRss>
		</item>
		<item>
		<title>Installing Netatalk AFP with SSL (encrypted authentication) on Ubuntu Hardy Heron 8.04 LTS Server</title>
		<link>http://dragffy.com/blog/posts/installing-netatalk-afp-with-ssl-encrypted-authentication-on-ubuntu-hardy-heron-804-lts-server</link>
		<comments>http://dragffy.com/blog/posts/installing-netatalk-afp-with-ssl-encrypted-authentication-on-ubuntu-hardy-heron-804-lts-server#comments</comments>
		<pubDate>Mon, 12 May 2008 15:19:21 +0000</pubDate>
		<dc:creator>Gabe</dc:creator>
		
		<category><![CDATA[HowTo]]></category>

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

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

		<category><![CDATA[Operating System]]></category>

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

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

		<guid isPermaLink="false">http://dragffy.com/blog/?p=51</guid>
		<description><![CDATA[Installing Netatalk from the repositories means that when you connect using a Mac client you will be warned that you are going to send your password in the clear. Obviously this isn&#8217;t great for security, and being prompted every time you want to connect is annoying. This occurs because Netatalk in the Ubuntu repositories is [...]]]></description>
			<content:encoded><![CDATA[<p>Installing Netatalk from the repositories means that when you connect using a Mac client you will be warned that you are going to send your password in the clear. Obviously this isn&#8217;t great for security, and being prompted every time you want to connect is annoying. This occurs because Netatalk in the Ubuntu repositories is compiled without SSL support (SSL is what handles the encryption).</p>
<p>The key to getting this to work is to get the Netatalk source code and compile it yourself. Don&#8217;t worry, it&#8217;s been done hundreds of times before and if you follow this tutorial closely you should be fine.</p>
<p>The commands written always start with a dollar sign ($), you should not type this, it just indicates the commands should be typed at a standard user prompt in the terminal.</p>
<p>First off it&#8217;s a good idea to switch to your home directory:<br />
<code>$ cd ~</code></p>
<p>Make a new directory to hold the hundreds of small Netatalk files:<br />
<code>$ mkdir netatalk</code></p>
<p>Ensure you have essential development libraries and tools installed:<br />
<code>$ sudo aptitude install libdb4.2-dev libslp-dev autotools-dev devscripts cracklib2-dev dpkg-dev libssl-dev</code></p>
<p>Change in to the newly created directory:<br />
<code>$ cd netatalk</code></p>
<p>Install the netatalk source code:<br />
<code>$ sudo apt-get source netatalk</code></p>
<p>Install all required dependencies for netatalk:<br />
<code>$ sudo apt-get build-dep netatalk</code></p>
<p>A new directory called <code>netatalk-2.0.3</code> should have been created, change in to that directory:<br />
<code>$ cd netatalk-2.0.3</code></p>
<p>Compile Netatalk with the SSL option:<br />
<code>$ DEB_BUILD_OPTIONS=ssl sudo dpkg-buildpackage -us -uc</code></p>
<p>Install the finished product!:<br />
<code>$ sudo debi</code></p>
]]></content:encoded>
			<wfw:commentRss>http://dragffy.com/blog/posts/installing-netatalk-afp-with-ssl-encrypted-authentication-on-ubuntu-hardy-heron-804-lts-server/feed</wfw:commentRss>
		</item>
		<item>
		<title>HTML Helper for generating a country drop-down list in CodeIgniter</title>
		<link>http://dragffy.com/blog/posts/html-helper-for-generating-a-country-drop-down-list-in-codeigniter</link>
		<comments>http://dragffy.com/blog/posts/html-helper-for-generating-a-country-drop-down-list-in-codeigniter#comments</comments>
		<pubDate>Fri, 09 May 2008 12:04:50 +0000</pubDate>
		<dc:creator>Gabe</dc:creator>
		
		<category><![CDATA[CodeIgniter]]></category>

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

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

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

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

		<guid isPermaLink="false">http://dragffy.com/blog/?p=44</guid>
		<description><![CDATA[Frustrated at having to create my own drop-down country lists in CI I created a helper for it. It can even work with the CI Validation class, so if the form is submitted and fails validation when it is redisplayed the same country is selected as the form was submitted with.
Download the file MY_form_helper.php and [...]]]></description>
			<content:encoded><![CDATA[<p>Frustrated at having to create my own drop-down country lists in CI I created a helper for it. It can even work with the CI Validation class, so if the form is submitted and fails validation when it is redisplayed the same country is selected as the form was submitted with.</p>
<p>Download the file <a href='http://dragffy.com/blog/wp-content/uploads/2008/06/my_form_helperphp.zip'>MY_form_helper.php</a> and put it in the folder: <code>/system/application/helpers/</code>.</p>
<p>Download the file <a href='http://dragffy.com/blog/wp-content/uploads/2008/06/countriesphp.zip'>countries.php</a> and place that in <code>/system/application/config/</code>.</p>
<p>You will now be able to create drop-down lists of countries in your views like this:<br />
<code>< ?=form_countries( 'country', $this->validation->country, array( &#8217;style&#8217; => &#8216;width: 250px&#8217; ) )?></code></p>
<p>Ensure that you create a validation rule called &#8220;country&#8221; in your controller and that you are loading the form helper.</p>
<p><code>form_countries()</code> takes three arguments. The first is the name you would like to give the select box, this is required. The second is the country to select by default - this could be something like &#8216;GB&#8217;, or <code>$this->validation->country</code>, otherwise you can leave it blank. The third argument is any additional properties to give the select box, you can leave this blank, or pass an array. In the example above we also set the width to 250x. The country chosen by the user will be returned to the script as a two-letter ISO country code, if you are validating this then you can set the min and max length values as 2, and accept alphabetical characters only. If using MySQL as your database you will get best performance by creating a column of the type char with a length of 2.</p>
]]></content:encoded>
			<wfw:commentRss>http://dragffy.com/blog/posts/html-helper-for-generating-a-country-drop-down-list-in-codeigniter/feed</wfw:commentRss>
		</item>
		<item>
		<title>Bug in Plesk mailbox quota management</title>
		<link>http://dragffy.com/blog/posts/bug-in-plesk-mailbox-quota-management</link>
		<comments>http://dragffy.com/blog/posts/bug-in-plesk-mailbox-quota-management#comments</comments>
		<pubDate>Fri, 09 May 2008 10:43:38 +0000</pubDate>
		<dc:creator>Gabe</dc:creator>
		
		<category><![CDATA[Information]]></category>

		<category><![CDATA[Operating System]]></category>

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

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

		<guid isPermaLink="false">http://dragffy.com/blog/?p=43</guid>
		<description><![CDATA[Initially I had set a mail account with a quota of 200000, or roughly 200MB. The user complained of a full mailbox, despite using Plesk to up the limit to 2GB, and then unlimited the account continued to bounce emails saying:
"Recipient's mailbox is full"
I found people complaining of a bug in version 7.5 of Plesk, [...]]]></description>
			<content:encoded><![CDATA[<p>Initially I had set a mail account with a quota of 200000, or roughly 200MB. The user complained of a full mailbox, despite using Plesk to up the limit to 2GB, and then unlimited the account continued to bounce emails saying:<br />
<code>"Recipient's mailbox is full"</code></p>
<p>I found people complaining of a bug in version 7.5 of Plesk, but it seems this is also present in 8.3. The problem, I discovered after nosing around the config files of the server, was that any changes I made in Plesk weren&#8217;t saved. Ultimately I found the limit in the config file remained at 200MB, despite numerous changes. The quota config file is located at:<br />
<code>/var/qmail/mailnames/example.com/username/@mbox.quota</code></p>
<p>Manually edit that file so it has the quota you want. I like to use vim:<br />
<code>vim /var/qmail/mailnames/example.com/username/\@mbox.quota</code><br />
(run this as root)</p>
<p>After editing, save the changes, and you won&#8217;t need to restart any services or the server. Changes should take effect.</p>
<p>Note, that this was performed on a CentOS 5 installation, so paths and instructions may vary slightly on other systems.</p>
]]></content:encoded>
			<wfw:commentRss>http://dragffy.com/blog/posts/bug-in-plesk-mailbox-quota-management/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
