<?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>Vim, Cygwin, MySQL &#38; Zsh Tips</title>
	<atom:link href="http://zzapper.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://zzapper.co.uk</link>
	<description></description>
	<lastBuildDate>Thu, 26 Aug 2010 22:44:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Common Programmer Mistakes</title>
		<link>http://zzapper.co.uk/common-programmer-mistakes/</link>
		<comments>http://zzapper.co.uk/common-programmer-mistakes/#comments</comments>
		<pubDate>Thu, 26 Aug 2010 22:10:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Coding Tips]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[rollback]]></category>

		<guid isPermaLink="false">http://zzapper.co.uk/?p=119</guid>
		<description><![CDATA[I for my sins code in PHP,Perl,ColdFusion using database MySQL and also write JavaScript, XML and battle with CSS and Ajax etc. Often I&#8217;m working on these projects in parallel which gets kind of stressful. Anyway I let my standards slip recently and made the following mistakes and suffered for it. Not immediately taking my [...]]]></description>
			<content:encoded><![CDATA[<p>I for my sins code in PHP,Perl,ColdFusion using database MySQL  and also write JavaScript, XML and battle with CSS and Ajax etc. Often I&#8217;m working on these projects in parallel which gets kind of stressful. Anyway I let my standards slip recently and made the following mistakes and suffered for it.</p>
<ul>
<li>Not immediately taking my own backup of the files I was working so I could rollback at any time and as importantly prove whether my changes had or had not caused a regression or bug</li>
<li>Leaving test files lying about, so I later got confused as to which was the actual version</li>
<li>To my credit have been using git for version control</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://zzapper.co.uk/common-programmer-mistakes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VIM 7.3 Released</title>
		<link>http://zzapper.co.uk/vim-7-3-released/</link>
		<comments>http://zzapper.co.uk/vim-7-3-released/#comments</comments>
		<pubDate>Sun, 22 Aug 2010 13:10:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://zzapper.co.uk/?p=115</guid>
		<description><![CDATA[Vim 7.3 is a stability release integrating hundreds of patches. It does contain however some new enhancements. The most notable additions since 7.2: - Persistent undo and undo for reload - Blowfish encryption, encryption of the swap file - Conceal text - Lua interface - Python 3 interface Persistent undo is probably the feature which [...]]]></description>
			<content:encoded><![CDATA[<p>Vim 7.3 is a stability release integrating hundreds of patches. It does contain however some new  enhancements. </p>
<p>The most notable additions since 7.2:<br />
- Persistent undo and undo for reload<br />
- Blowfish encryption, encryption of the swap file<br />
- Conceal text<br />
- Lua interface<br />
- Python 3 interface </p>
<p>Persistent undo is probably the feature which most interests me. This allows you to undo changes you made last time you edited a file; a feature which must be used with some care obviously!. It works by saving the changes in a temporary file. A file is created for each file you modify, to avoid cluttering up your directories you can configure vim to use a special directory.</p>
<p>Download the latest VIM here <a href="http://www.vim.org/download.php">vim.org/download.php</a> </p>
<p>Windows Users can go directly to this link <a href="ftp://ftp.vim.org/pub/vim/pc/gvim73.exe">ftp://ftp.vim.org/pub/vim/pc/gvim73.exe</a> which is the simplest way to upgrade. By the way REMEMBER to backup your .vimrc file!!!</p>
<p>Recently I&#8217;ve been using the Cream version <a href="http://sourceforge.net/projects/cream/files/Vim">http://sourceforge.net/projects/cream/files/Vim</a> which maintains an up-to-date single click install version of VIM with all patches  it is already at version 7.3.3. And just to confirm this is the version without Cream.</p>
]]></content:encoded>
			<wfw:commentRss>http://zzapper.co.uk/vim-7-3-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Tell How long Since a PC has Been Restarted</title>
		<link>http://zzapper.co.uk/how-to-tell-how-long-since-a-pc-has-been-restarted/</link>
		<comments>http://zzapper.co.uk/how-to-tell-how-long-since-a-pc-has-been-restarted/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 22:45:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://zzapper.co.uk/?p=109</guid>
		<description><![CDATA[From A Dos Window net statistics workstation]]></description>
			<content:encoded><![CDATA[<p>From A Dos Window</p>
<p>net statistics workstation</p>
]]></content:encoded>
			<wfw:commentRss>http://zzapper.co.uk/how-to-tell-how-long-since-a-pc-has-been-restarted/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Great Tip : Opening Multiple Instances of an Application from the Windows Taskbar</title>
		<link>http://zzapper.co.uk/great-tip-opening-multiple-instances-of-an-application-from-the-windows-taskbar/</link>
		<comments>http://zzapper.co.uk/great-tip-opening-multiple-instances-of-an-application-from-the-windows-taskbar/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 17:05:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Cygwin]]></category>
		<category><![CDATA[windows Tips]]></category>
		<category><![CDATA[windows 7 taskbar]]></category>

		<guid isPermaLink="false">http://zzapper.co.uk/great-tip-opening-multiple-instances-of-an-application-from-the-windows-taskbar/</guid>
		<description><![CDATA[Tip 1:- I always need several Cygwin Windows open so I was very frustrated by Windows 7 only allowing me to open one Cygwin from the Windows 7 Taskbar. This is because once you click on an icon it disappears from the Taskbar! This is different to the behavior of the previous XP or Vista [...]]]></description>
			<content:encoded><![CDATA[<p>Tip 1:-<br />
I always need several Cygwin Windows open so I was very frustrated by Windows 7 only allowing me to open one Cygwin from the Windows 7 Taskbar. This is because once you click on an icon it disappears from the Taskbar! This is different to the behavior of the previous XP or Vista Taskbar and often prompts users to select the Vista Taskbar compatibility. There is fortunately a work around depress the SHIFT button and then click the existing open icon on the taskbar and voila you will spawn a application window! </p>
<p>Tip 2:-<br />
The Properties Tab is HIDDEN on the Windows 7 Taskbar and had me hating it until I found it. Rightmouse click the relevant Application Icon on the Taskbar then hover over the revealed tab and Right Mouse Click this and there magically is the <strong>Properties Tab</strong>!!</p>
]]></content:encoded>
			<wfw:commentRss>http://zzapper.co.uk/great-tip-opening-multiple-instances-of-an-application-from-the-windows-taskbar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perl: Regexp to filter out/match just the price/floating point number ie digits and dots</title>
		<link>http://zzapper.co.uk/perl-regexp-to-filter-outmatch-just-the-pricefloating-point-number-ie-digits-and-dots/</link>
		<comments>http://zzapper.co.uk/perl-regexp-to-filter-outmatch-just-the-pricefloating-point-number-ie-digits-and-dots/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 11:05:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[price]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[regexp]]></category>

		<guid isPermaLink="false">http://zzapper.co.uk/perl-regexp-to-filter-outmatch-just-the-pricefloating-pint-number-ie-digits-and-dots/</guid>
		<description><![CDATA[There are two ways:- $price=~tr/0-9.//cd; # delete anything but 0-9 and a real dot $row_array[6]=~s/[^0-9.]//g; # clean up price, remove pound/dollar sign etc]]></description>
			<content:encoded><![CDATA[<p>There are two ways:-</p>
<p>$price=~tr/0-9.//cd; # delete anything but 0-9 and a real dot</p>
<p>$row_array[6]=~s/[^0-9.]//g; # clean up price, remove pound/dollar sign etc</p>
]]></content:encoded>
			<wfw:commentRss>http://zzapper.co.uk/perl-regexp-to-filter-outmatch-just-the-pricefloating-point-number-ie-digits-and-dots/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parsing HTML with preg_match</title>
		<link>http://zzapper.co.uk/parsing-html-with-preg_match/</link>
		<comments>http://zzapper.co.uk/parsing-html-with-preg_match/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 20:46:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Coding Tips]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[regex]]></category>

		<guid isPermaLink="false">http://zzapper.co.uk/?p=97</guid>
		<description><![CDATA[preg_match_all(&#8216;#&#60;b>.+?&#60;/b>#i&#8217;, $html, $matches); // ? means non-greedy and is absolutely critical $match[1], $match[2] contain the results Non greedy stops the match gobbling everything between the first bold tag and the very last. I&#8217;ve never quite understood why greedy is the default behavior of RegExp (Regular Expressions) but I guess there&#8217;s a good reason for it. [...]]]></description>
			<content:encoded><![CDATA[<p>preg_match_all(&#8216;#&lt;b>.+?&lt;/b>#i&#8217;, $html, $matches);<br />
// ? means non-greedy and is absolutely critical</p>
<p>$match[1], $match[2] contain the results</p>
<p>Non greedy stops the match gobbling everything between the first bold tag and the very last. I&#8217;ve never quite understood why greedy is the default behavior of RegExp (Regular Expressions) but I guess there&#8217;s a good reason for it.</p>
<p>PHP also has the very useful <a href="http://www.php.net/manual/en/function.strip-tags.php">strip_tags</a> function.</p>
]]></content:encoded>
			<wfw:commentRss>http://zzapper.co.uk/parsing-html-with-preg_match/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Classic Programming Error: Variables inside a loop</title>
		<link>http://zzapper.co.uk/classic-programming-error-variables-inside-a-loop/</link>
		<comments>http://zzapper.co.uk/classic-programming-error-variables-inside-a-loop/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 22:23:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Coding Tips]]></category>

		<guid isPermaLink="false">http://zzapper.co.uk/?p=95</guid>
		<description><![CDATA[This for loop is OK foreach($cargo_data as $cid=&#62;$cargo_record) { $cargo_id=$cargo_data[$cid]['cargo_id']; $section=$cargo_data[$cid]['section']; &#8230; } But then later you add a condition cargo_id&#62;6 foreach($cargo_data as $cid=&#62;$cargo_record) { if ($cid&#62;6) {$cargo_id=$cargo_data[$cid]['cargo_id'];} $section=$cargo_data[$cid]['section']; &#8230; } Now the bug is that if $cid is less than 6 $cargo_id is not set and will likely inherit the value it was set [...]]]></description>
			<content:encoded><![CDATA[<p>This for loop is OK</p>
<p>foreach($cargo_data as $cid=&gt;$cargo_record)<br />
{<br />
$cargo_id=$cargo_data[$cid]['cargo_id'];<br />
$section=$cargo_data[$cid]['section'];<br />
&#8230;<br />
}</p>
<p>But then later you add a condition cargo_id&gt;6</p>
<p>foreach($cargo_data as $cid=&gt;$cargo_record)<br />
{<br />
if ($cid&gt;6) {$cargo_id=$cargo_data[$cid]['cargo_id'];}<br />
$section=$cargo_data[$cid]['section'];<br />
&#8230;<br />
}</p>
<p>Now the bug is that if $cid is less than 6 $cargo_id is not set and will likely inherit the value it was set to in the last loop this type of error may not be immediately noticeable but can cause chaos. In this simple example it is easy to see that their should be an else clause, however the real solution is to systematically  initialize all the variables at the beginning of the loop.</p>
]]></content:encoded>
			<wfw:commentRss>http://zzapper.co.uk/classic-programming-error-variables-inside-a-loop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Converting a Textified File Name back into Title Case</title>
		<link>http://zzapper.co.uk/converting-a-textified-file-name-back-into-title-case/</link>
		<comments>http://zzapper.co.uk/converting-a-textified-file-name-back-into-title-case/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 22:25:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[zsh]]></category>
		<category><![CDATA[textified]]></category>
		<category><![CDATA[title case]]></category>

		<guid isPermaLink="false">http://zzapper.co.uk/converting-a-textified-file-name-back-into-title-case/</guid>
		<description><![CDATA[This could easily be done with Perl but here is a zsh solution I want to convert a textified string to a Title Case Phrase > > eg > fred-goat-dog.jpg to Fred Goat Dog > % print ${${(Cs:-:):-fred-goat-dog.jpg}%.*} Fred Goat Dog This curiously uses a smiley face though foo=fred-goat-dog.jpg echo ${(C)foo:gs/-/ /:r} might be more [...]]]></description>
			<content:encoded><![CDATA[<p>This could easily be done with Perl but here is a zsh solution</p>
<p>I want to convert a textified string to a Title Case Phrase<br />
><br />
> eg<br />
> fred-goat-dog.jpg to Fred Goat Dog<br />
>    </p>
<p>% print ${${(Cs:-:):-fred-goat-dog.jpg}%.*}<br />
Fred Goat Dog</p>
<p>This curiously uses a smiley face though<br />
foo=fred-goat-dog.jpg<br />
echo ${(C)foo:gs/-/ /:r} might be more elegant<br />
From the zsh newsgroup (RD&#038;MM)</p>
<p>and to textify a phrase</p>
<p>s=&#8217;Fred Goat Dog&#8217;<br />
print ${(L)s:gs/ /-/}.jpg<br />
or<br />
print ${(L)s// /-}.jpg</p>
]]></content:encoded>
			<wfw:commentRss>http://zzapper.co.uk/converting-a-textified-file-name-back-into-title-case/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Useful VIM Abbreviations for Debugging Perl</title>
		<link>http://zzapper.co.uk/useful-vim-abbreviations-for-debugging-perl/</link>
		<comments>http://zzapper.co.uk/useful-vim-abbreviations-for-debugging-perl/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 21:51:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://zzapper.co.uk/?p=87</guid>
		<description><![CDATA[iab perlb print &#8220;&#60;p>debug ::: $_ :: $&#8217; :: $` line &#8220;.__LINE__.&#8221;\n&#8221;;exit; iab perlbb print &#8220;&#60;p>debug ::: &#60;C-R>a line &#8220;.__LINE__.&#8221;\n&#8221;;exit; iab perlbd do{print &#8220;&#60;p>debug :: &#60;C-R>a line &#8220;.__LINE__.&#8221;\n&#8221;;exit} if $_ =~ /\w\w/i; iab perld use Data::Dumper; print Dumper %ENV; the &#60;C-R>a automatically inserts whatever variable you had previously stored in register a]]></description>
			<content:encoded><![CDATA[<div class=box>
iab perlb  print &#8220;&lt;p>debug ::: $_ :: $&#8217; :: $`  line &#8220;.__LINE__.&#8221;\n&#8221;;exit;<br />
iab perlbb print &#8220;&lt;p>debug ::: &lt;C-R>a  line &#8220;.__LINE__.&#8221;\n&#8221;;exit;<br />
iab perlbd do{print &#8220;&lt;p>debug :: &lt;C-R>a  line &#8220;.__LINE__.&#8221;\n&#8221;;exit} if $_ =~ /\w\w/i;<br />
iab perld use Data::Dumper; print Dumper %ENV;</p>
<p>the &lt;C-R>a automatically inserts whatever variable you had previously stored in register a
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://zzapper.co.uk/useful-vim-abbreviations-for-debugging-perl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Copying all but today&#8217;s files</title>
		<link>http://zzapper.co.uk/copying-all-but-todays-files/</link>
		<comments>http://zzapper.co.uk/copying-all-but-todays-files/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 23:23:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://zzapper.co.uk/?p=85</guid>
		<description><![CDATA[I&#8217;d put some new files into a folder before remembering to mothball all the old files:- Here is a zsh solution:- &#62;mv *.*(^m-1)   ./old]]></description>
			<content:encoded><![CDATA[<p>I&#8217;d put some new files into a folder before remembering to mothball all the old files:-</p>
<p>Here is a zsh solution:-</p>
<p>&gt;mv *.*(^m-1)   ./old</p>
]]></content:encoded>
			<wfw:commentRss>http://zzapper.co.uk/copying-all-but-todays-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
