<?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>My Quick Fix &#187; Tools</title>
	<atom:link href="http://myquickfix.co.uk/index.php/category/computers/web-development/tools/feed/" rel="self" type="application/rss+xml" />
	<link>http://myquickfix.co.uk</link>
	<description>Quick fixes for niggly problems...</description>
	<lastBuildDate>Thu, 24 Sep 2009 15:10:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Quick &#039;Lorem Ipsum&#039; plugin / extension for IE</title>
		<link>http://myquickfix.co.uk/index.php/2009/04/lorem-ipsum-ie/</link>
		<comments>http://myquickfix.co.uk/index.php/2009/04/lorem-ipsum-ie/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 12:09:16 +0000</pubDate>
		<dc:creator>hutch</dc:creator>
				<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Registry]]></category>

		<guid isPermaLink="false">http://www.myquickfix.co.uk/?p=334</guid>
		<description><![CDATA[Problem
While doing web development, I frequently need to insert lorem ipsum into a text field or textarea. To do this &#8211; bearing in mind that I don&#8217;t really like or use bookmarks, too messy &#8211; I tend to google &#8220;lorem ipsum&#8221;, hit lipsum.com, select/copy the block of text, and then return to my form field and paste it.
I wanted a quicker solution, and as I find myself using IE more and more to develop in now (thanks to the excellent &#8216;Developer Tools&#8217; extension &#8211; never thought I&#8217;d say that!) my lorem ...]]></description>
			<content:encoded><![CDATA[<h2>Problem</h2>
<p>While doing web development, I frequently need to insert <a title="Lorem Ipsum explanation" href="http://en.wikipedia.org/wiki/Lorem_ipsum" target="_blank">lorem ipsum</a> into a text field or textarea. To do this &#8211; bearing in mind that I don&#8217;t really like or use bookmarks, too messy &#8211; I tend to google &#8220;lorem ipsum&#8221;, hit <a href="http://www.lipsum.com/">lipsum.com</a>, select/copy the block of text, and then return to my form field and paste it.</p>
<p>I wanted a quicker solution, and as I find myself using IE more and more to develop in now (thanks to the excellent &#8216;Developer Tools&#8217; extension &#8211; never thought I&#8217;d say that!) my lorem ipsum fix would have to be in the form of an IE toolbar button or menu item.</p>
<h2>Solution</h2>
<p>It turns out that adding a simple javascript based text field filler option to a context menu is really easy, so that&#8217;s what I did. Here are the steps:</p>
<p><strong>Firstly:</strong> Create the javascript to access the currently focused field, and insert the lorem ipsum text. Create a new html file in a location of your choice &#8211;  I used C:\Program Files\Internet Explorer\Plugins &#8211; and copy the following code into it:</p>
<pre name="code" class="js">&lt;script language="JavaScript"&gt;
var parentwin = external.menuArguments;
var doc = parentwin.document;
var rng = doc.selection.createRange();
rng.text = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, \
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. \
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi \
ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit \
in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur \
sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt \
mollit anim id est laborum.";
&lt;/script&gt;</pre>
<p>Save the file as loremipsum.htm.</p>
<p><strong>Secondly:</strong> Create the registry entry for the menu item:</p>
<ol>
<li>Open/run &#8216;regedit&#8217; (Start &gt; run&#8230; &gt; &#8220;regedit&#8221; &gt; &#8216;Ok&#8217;)</li>
<li>Use the tree to navigate to:<br />
<em>HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt</em><br />
using the tree view on the left of the Registry Editor.</li>
<li>Create a new key (Right click, &#8220;New&#8221; &gt; &#8220;Key&#8221;) and call it &#8220;Lorem Ipsum&#8221; or anything you like.</li>
<li>Inside the new key, open the &#8216;default&#8217; string value that&#8217;s already there (double click on it), and enter the path to the script you created just now. i.e. <em>C:\Program Files\Internet Explorer\Plugins\loremipsum.htm </em></li>
<li>Now create a new DWORD value (Right click, &#8220;New&#8221; &gt; &#8220;DWORD Value&#8221;) and rename it &#8220;Contexts&#8221;. Set the value to 0&#215;04 (hex) or 4 (decimal). <a title="Microsofts info on Contexts values" href="http://msdn.microsoft.com/en-us/library/aa753589.aspx" target="_blank">Here&#8217;s</a> an explanation of the different values.</li>
</ol>
<div id="attachment_365" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-365" title="lorem-reg" src="http://www.myquickfix.co.uk/wp-content/uploaded/2009/04/lorem-reg.png" alt="The new Key and values in RegEdit" width="500" height="250" /><p class="wp-caption-text">The new Key and values in RegEdit</p></div>
<p>That&#8217;s it! Now open IE, find a textarea or text field, right click, and you should see something like this:</p>
<div id="attachment_368" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-368" title="lorem-action" src="http://www.myquickfix.co.uk/wp-content/uploaded/2009/04/lorem-action.png" alt="Note the new highlighted option in the context menu" width="500" height="246" /><p class="wp-caption-text">Note the new highlighted option in the context menu</p></div>
]]></content:encoded>
			<wfw:commentRss>http://myquickfix.co.uk/index.php/2009/04/lorem-ipsum-ie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Textpad Regular Expressions</title>
		<link>http://myquickfix.co.uk/index.php/2008/12/textpad-regular-expressions/</link>
		<comments>http://myquickfix.co.uk/index.php/2008/12/textpad-regular-expressions/#comments</comments>
		<pubDate>Wed, 10 Dec 2008 13:31:40 +0000</pubDate>
		<dc:creator>hutch</dc:creator>
				<category><![CDATA[Textpad]]></category>
		<category><![CDATA[regular expressions]]></category>

		<guid isPermaLink="false">http://www.myquickfix.co.uk/?p=77</guid>
		<description><![CDATA[Textpad is a great editor, been using it for years, but never really used it to it&#8217;s full potential. Recently I needed to do some find/replace work in some huge SQL and CSV files &#8211; huge enough to make manual editing impossible &#8211; so I had to start using Textpad&#8217;s Regular Expression capabilities.
Here are a few expressions that came in handy. I intend to add to this list as time goes on.
Regexp shown in Green, my comments in Red.
CSV Editing:
Remove spaces and tab characters at the beginning of a line:
Find ...]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.textpad.com/">Textpad</a> is a great editor, been using it for years, but never really used it to it&#8217;s full potential. Recently I needed to do some find/replace work in some huge SQL and CSV files &#8211; huge enough to make manual editing impossible &#8211; so I had to start using Textpad&#8217;s Regular Expression capabilities.</p>
<p>Here are a few expressions that came in handy. I intend to add to this list as time goes on.<br />
Regexp shown in <span style="color: #008000;">Green</span>, my comments in <span style="color: #cc0000;">Red</span>.</p>
<p><strong>CSV Editing:</strong></p>
<p>Remove spaces and tab characters at the <em>beginning</em> of a line:<br />
<code>Find what: <span style="color: #008000;">^[ \t]+</span><br />
Replace With: <span style="color: #cc0000;">don't enter anything in the field</span></code><br />
Remove spaces and tab characters at the <em>end</em> of a line:<br />
<code>Find what: <span style="color: #008000;">[ \t]+$</span><br />
Replace With: <span style="color: #cc0000;">don't enter anything in the field</span></code><br />
Add &#8220;Hello&#8221; to the <em>beginning</em> of every line:<br />
<code>Find what: <span style="color: #008000;">\(^.*\)</span><br />
Replace With: <span style="color: #008000;">Hello \1</span></code><br />
Add &#8220;Hello &#8221; to the <em>beginning</em> and &#8221; World&#8221; to the <em>end</em> of every line:<br />
<code>Find what: <span style="color: #008000;">\(^.*\)</span><br />
Replace With: <span style="color: #008000;">Hello \1 World</span> <span style="color: #cc0000;">(watch the spaces)</span></code><br />
Find empty fields (i.e. &#8220;, ,&#8221;) with spaces or tabs in, and replace with empty field (&#8220;,,&#8221;):<br />
<code>Find what: <span style="color: #008000;">,[ \t*],</span><br />
Replace With: <span style="color: #008000;">,,</span> <span style="color: #cc0000;">(just that, nothing else, just 2 commas)</span></code><br />
Remove blank lines in a text file, by searching for two linebreaks next to each other, and replacing with one:<br />
<code>Find what: <span style="color: #008000;">\n\n</span><br />
Replace With: <span style="color: #008000;">\n</span></code></p>
<p> </p>
<p><strong>Replacement Expressions:</strong></p>
<p>Extract email addresses only from the following text: &#8220;Joe Blogs (job.blogs@blogsworld.com)&#8221;<br />
This expression searches for 2 tagged expressions, firstly any printable characters including spaces up to the first open bracket symbol, secondly anything between the brackets. It then replaces the whole line with the second match.<br />
<code>Find what: <span style="color: #008000;">^\([[:graph:] ]+\)(\([[:graph:] ]+\))</span><br />
Replace With: <span style="color: #008000;">\2</span></code></p>
<p> </p>
<p><strong>Notes:</strong></p>
<ul>
<li>The expressions above need the &#8216;Regular Expression&#8217; condition to be ticked in the Find or Replace dialogue boxes for them to work.</li>
<li>Text pad needs to be set to use UNIX not POSIX style expressions. To set this, open &#8216;Configure &gt; Preferences&#8217; (Ctrl+Q,P), find the &#8216;Editor&#8217; settings, and untick the &#8216;Use POSIX regular expression syntax&#8217; box.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://myquickfix.co.uk/index.php/2008/12/textpad-regular-expressions/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>
