<?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/" version="2.0">

<channel>
	<title>onemoretake</title>
	
	<link>http://www.onemoretake.com</link>
	<description />
	<lastBuildDate>Wed, 09 May 2012 11:52:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/onemoretake/feed" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="onemoretake/feed" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>ReCSS with Combres Support</title>
		<link>http://www.onemoretake.com/2012/05/08/recss-with-combres-support/</link>
		<comments>http://www.onemoretake.com/2012/05/08/recss-with-combres-support/#comments</comments>
		<pubDate>Wed, 09 May 2012 11:52:27 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.onemoretake.com/?p=418</guid>
		<description><![CDATA[I have made extensive use of the great bookmarklet ReCSS that reloads a page&#8217;s css without reloading the entire page. It saves masses of time when developing UI but I noticed that on certain projects it has no effect. I realised that this was because those projects were using the equally useful Combres resource combining [...]]]></description>
			<content:encoded><![CDATA[<p>I have made extensive use of the great bookmarklet <a href="http://david.dojotoolkit.org/recss.html" target="_blank">ReCSS</a> that reloads a page&#8217;s css without reloading the entire page. It saves masses of time when developing UI but I noticed that on certain projects it has no effect.</p>
<p>I realised that this was because those projects were using the equally useful <a href="http://combres.codeplex.com/" target="_blank">Combres</a> resource combining library for .Net. Combres uses a number in the url path for caching, and without changing that, any updates to the css file will not be delivered to the browser.</p>
<p>Today I sat down and tweaked the ReCSS bookmarklet so that it checks the url for the /combres.axd path in the urls and changes the number in the url if it is present.</p>
<p>Here is the <a href="javascript:(function(){void(function(){var%20i,a,s;a=document.getElementsByTagName('link');for(i=0;i%3Ca.length;i++){s=a[i];if(s.rel.toLowerCase().indexOf('stylesheet')%3E=0%20%26%26%20s.href){var%20h=s.href.replace(/(%26|\%3F)forceReload=\d+/,''),myregexp=/(.*\/combres\.axd\/.+\/)(-%3F\d+)\/$/im,match=myregexp.exec(h);if(match%20!=null){s.href=match[1]+(new%20Date().valueOf())+'/';}else{s.href=h+(h.indexOf('%3F')%3E=0%3F'%26':'%3F')+'forceReload='+(new%20Date().valueOf());}}}})();})();">updated ReCSS bookmarklet</a>. Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.onemoretake.com/2012/05/08/recss-with-combres-support/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TFS Build And Multiple Websites In One Web Role On Azure</title>
		<link>http://www.onemoretake.com/2011/06/08/tfs-build-and-multiple-websites-on-azure/</link>
		<comments>http://www.onemoretake.com/2011/06/08/tfs-build-and-multiple-websites-on-azure/#comments</comments>
		<pubDate>Thu, 09 Jun 2011 01:00:53 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Azure]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[tfs build]]></category>
		<category><![CDATA[web roles]]></category>

		<guid isPermaLink="false">http://www.onemoretake.com/?p=391</guid>
		<description><![CDATA[Since the 1.3 sdk update, setting up multiple websites on a single web role is pretty straight forward. However, there is a little bit of a gotcha when using TFS build to compile and publish the packages. The problem is that when you combine two or more website projects into a single role, the azure [...]]]></description>
			<content:encoded><![CDATA[<p>Since the 1.3 sdk update, setting up multiple websites on a single web role is <a href="http://msdn.microsoft.com/en-us/library/gg433110.aspx">pretty straight forward</a>. However, there is a little bit of a gotcha when using TFS build to compile and publish the packages. </p>
<p>The problem is that when you combine two or more website projects into a single role, the azure project still only compiles the primary website within the project. The other projects seem to just be copied from the location specified physicalDirectory attribute and included in the published package. Ensuring those are included in the package during the build process on your TFS Build server is fairly straight forward &#8211; you just add them in the &#8216;Items to Build&#8217; of your build definition (before the cloud project!). However, what that does not do is transform the web.config files of those projects. The build seems to only compile the code and none of the extra tasks.</p>
<p>Discovering this took up two days of investigating &#8211; the problem manifested in a strange authentication cookie domain issue because our config transform should have replaced the authentication settings. Once we realised what was happening, fixing it did not take so long. </p>
<p>We add an after build event that transforms the config files in the project files but only if it looks like we are on the build server. Unload the website project in question and edit the .csproj file. Add an AfterBuild target as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Target</span> <span style="color: #000066;">Name</span>=<span style="color: #ff0000;">&quot;AfterBuild&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #808080; font-style: italic;">&lt;!-- other tasks may already be here --&gt;</span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;TransformXml</span> <span style="color: #000066;">Condition</span>=<span style="color: #ff0000;">&quot;Exists('$(OutDir)\_PublishedWebsites\$(TargetName)')&quot;</span></span>
<span style="color: #009900;">                  <span style="color: #000066;">Source</span>=<span style="color: #ff0000;">&quot;Web.config&quot;</span> <span style="color: #000066;">Transform</span>=<span style="color: #ff0000;">&quot;$(ProjectConfigTransformFileName)&quot;</span></span>
<span style="color: #009900;">                  <span style="color: #000066;">Destination</span>=<span style="color: #ff0000;">&quot;$(OutDir)\_PublishedWebsites\$(TargetName)\Web.config&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>What this does is run the transforms on the web.config files if the build server _PublishedWebsites directory exists. </p>
<p>The only thing lacking here is the file tidy up &#8211; the original config files still remain and are deployed in the package along with other files that are usually removed during the build. This does not effect the website in any way but it would be nice to remove those too. Any suggestions on how would be gratefully received.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.onemoretake.com/2011/06/08/tfs-build-and-multiple-websites-on-azure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A JQuery UI Dropdown List</title>
		<link>http://www.onemoretake.com/2011/04/17/a-better-jquery-ui-combo-box/</link>
		<comments>http://www.onemoretake.com/2011/04/17/a-better-jquery-ui-combo-box/#comments</comments>
		<pubDate>Mon, 18 Apr 2011 06:22:08 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[autocomplete]]></category>
		<category><![CDATA[combobox]]></category>
		<category><![CDATA[jquery ui]]></category>

		<guid isPermaLink="false">http://www.onemoretake.com/?p=363</guid>
		<description><![CDATA[In a recent iteration of find.ly that I have been working on, I was asked to create a form that is far removed from the look of standard browser form controls. In particular, the dropdown lists look nothing like the native control and could not be reproduced using only css. This led me to the [...]]]></description>
			<content:encoded><![CDATA[<p>In a recent iteration of <a href="http://find.ly">find.ly</a> that I have been working on, I was asked to create a form that is far removed from the look of standard browser form controls. In particular, the dropdown lists look nothing like the native control and could not be reproduced using only css.</p>
<p>This led me to the <a href="http://jqueryui.com/demos/autocomplete/#combobox">jQuery UI combox</a> which uses the jQuery UI autocomplete control. This worked very nicely except that it is not a dropdown list that users are most used to seeing. As soon as the new form entered QA, I was pinged with a message saying that it was a bit awkward to use and would probably be difficult for users. I couldn&#8217;t disagree with that and this motivated me to try and see if I could make it more like a dropdown list.</p>
<p>After a few hours of head scratching, I am ready to present the first version of my control, which I would say is about 90% faithful to the feel of native control. There are a few things it does not do but I feel I am close enough to release it to the world for criticism. </p>
<p><a href="http://www.onemoretake.com/wp-content/uploads/2011/04/combodemo.htm" target="_blank">Try the demo</a></p>
<p>Here is the code:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    $.<span style="color: #660066;">widget</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;ui.combobox&quot;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
        _create<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003366; font-weight: bold;">var</span> self <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span>
				select <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">element</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
				selected <span style="color: #339933;">=</span> select.<span style="color: #660066;">children</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;:selected&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
				value <span style="color: #339933;">=</span> selected.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> selected.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">,</span>
				regSearch <span style="color: #339933;">=</span> <span style="color: #009966; font-style: italic;">/^[^a-zA-Z0-9]*([a-zA-Z0-9])/i</span><span style="color: #339933;">,</span>
				comboData <span style="color: #339933;">=</span> select.<span style="color: #660066;">children</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;option&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">map</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">value</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						<span style="color: #003366; font-weight: bold;">var</span> text <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> 
							labelHtml <span style="color: #339933;">=</span> self.<span style="color: #660066;">options</span>.<span style="color: #660066;">label</span> <span style="color: #339933;">?</span> self.<span style="color: #660066;">options</span>.<span style="color: #660066;">label</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> text<span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//allows list customization</span>
&nbsp;
						<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#123;</span>
							label<span style="color: #339933;">:</span> labelHtml<span style="color: #339933;">,</span>
							value<span style="color: #339933;">:</span> text<span style="color: #339933;">,</span>
							option<span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">this</span>
						<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span>
				<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #003366; font-weight: bold;">var</span> input <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">input</span> <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;input type='text' /&gt;&quot;</span><span style="color: #009900;">&#41;</span>
					.<span style="color: #660066;">insertAfter</span><span style="color: #009900;">&#40;</span>select<span style="color: #009900;">&#41;</span>
					.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span>value<span style="color: #009900;">&#41;</span>
					.<span style="color: #660066;">keydown</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span> event <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
							<span style="color: #003366; font-weight: bold;">var</span> keyCode <span style="color: #339933;">=</span> $.<span style="color: #660066;">ui</span>.<span style="color: #660066;">keyCode</span><span style="color: #339933;">;</span>
							<span style="color: #000066; font-weight: bold;">switch</span><span style="color: #009900;">&#40;</span> event.<span style="color: #660066;">keyCode</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
								<span style="color: #000066; font-weight: bold;">case</span> keyCode.<span style="color: #660066;">PAGE_UP</span><span style="color: #339933;">:</span>
								<span style="color: #000066; font-weight: bold;">case</span> keyCode.<span style="color: #660066;">PAGE_DOWN</span><span style="color: #339933;">:</span>
								<span style="color: #000066; font-weight: bold;">case</span> keyCode.<span style="color: #660066;">UP</span><span style="color: #339933;">:</span>
								<span style="color: #000066; font-weight: bold;">case</span> keyCode.<span style="color: #660066;">DOWN</span><span style="color: #339933;">:</span>
								<span style="color: #000066; font-weight: bold;">case</span> keyCode.<span style="color: #660066;">ENTER</span><span style="color: #339933;">:</span>
								<span style="color: #000066; font-weight: bold;">case</span> keyCode.<span style="color: #660066;">NUMPAD_ENTER</span><span style="color: #339933;">:</span>
								<span style="color: #000066; font-weight: bold;">case</span> keyCode.<span style="color: #660066;">TAB</span><span style="color: #339933;">:</span>
								<span style="color: #000066; font-weight: bold;">case</span> keyCode.<span style="color: #660066;">ESCAPE</span><span style="color: #339933;">:</span>
									<span style="color: #006600; font-style: italic;">//let autocomplete handle these</span>
									<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
								<span style="color: #003366; font-weight: bold;">default</span><span style="color: #339933;">:</span>
									<span style="color: #006600; font-style: italic;">//prevent autocomplete doing anything</span>
									event.<span style="color: #660066;">stopImmediatePropagation</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
									<span style="color: #006600; font-style: italic;">//only react to [a-zA-Z0-9]</span>
									<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>event.<span style="color: #660066;">keyCode</span> <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">91</span> <span style="color: #339933;">&amp;&amp;</span> event.<span style="color: #660066;">keyCode</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">59</span><span style="color: #009900;">&#41;</span>
										<span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span>event.<span style="color: #660066;">keyCode</span> <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">58</span> <span style="color: #339933;">&amp;&amp;</span> event.<span style="color: #660066;">keyCode</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">47</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
										<span style="color: #003366; font-weight: bold;">var</span> str <span style="color: #339933;">=</span> String.<span style="color: #660066;">fromCharCode</span><span style="color: #009900;">&#40;</span>event.<span style="color: #660066;">keyCode</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toLowerCase</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> currVal <span style="color: #339933;">=</span> input.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> opt<span style="color: #339933;">;</span>
&nbsp;
										<span style="color: #006600; font-style: italic;">//find all options whose first alpha character matches that pressed</span>
										<span style="color: #003366; font-weight: bold;">var</span> matchOpt <span style="color: #339933;">=</span> select.<span style="color: #660066;">children</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">filter</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
											<span style="color: #003366; font-weight: bold;">var</span> test <span style="color: #339933;">=</span> regSearch.<span style="color: #660066;">exec</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
											<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span>test <span style="color: #339933;">&amp;&amp;</span> test.<span style="color: #660066;">length</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">2</span> <span style="color: #339933;">&amp;&amp;</span> test<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">toLowerCase</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> str<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
										<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
										<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>matchOpt.<span style="color: #660066;">length</span> <span style="color: #009900;">&#41;</span> <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
&nbsp;
										<span style="color: #006600; font-style: italic;">//if there is something selected we need to find the next in the list</span>
										<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>currVal.<span style="color: #660066;">length</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
											<span style="color: #003366; font-weight: bold;">var</span> test <span style="color: #339933;">=</span> regSearch.<span style="color: #660066;">exec</span><span style="color: #009900;">&#40;</span>currVal<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
											<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>test <span style="color: #339933;">&amp;&amp;</span> test.<span style="color: #660066;">length</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">2</span> <span style="color: #339933;">&amp;&amp;</span> test<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">toLowerCase</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> str<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
												<span style="color: #006600; font-style: italic;">//the next one that begins with that letter</span>
												matchOpt.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>ix<span style="color: #339933;">,</span> el<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
													<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>el.<span style="color: #660066;">selected</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
														<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>ix <span style="color: #339933;">+</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;=</span> matchOpt.<span style="color: #660066;">length</span><span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
															opt <span style="color: #339933;">=</span> matchOpt<span style="color: #009900;">&#91;</span>ix <span style="color: #339933;">+</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
														<span style="color: #009900;">&#125;</span>
														<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
													<span style="color: #009900;">&#125;</span>
												<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
											<span style="color: #009900;">&#125;</span>
										<span style="color: #009900;">&#125;</span> 
&nbsp;
										<span style="color: #006600; font-style: italic;">//fallback to the first one that begins with that character</span>
										<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>opt<span style="color: #009900;">&#41;</span>
											opt <span style="color: #339933;">=</span> matchOpt<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
										<span style="color: #006600; font-style: italic;">//select that item</span>
										opt.<span style="color: #660066;">selected</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
										input.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span>opt.<span style="color: #660066;">text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
										<span style="color: #006600; font-style: italic;">//if the dropdown is open, find it in the list</span>
										<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>input.<span style="color: #660066;">autocomplete</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;widget&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066; font-weight: bold;">is</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;:visible&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
											input.<span style="color: #660066;">data</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;autocomplete&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">widget</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">children</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'li'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>		
												<span style="color: #003366; font-weight: bold;">var</span> $li <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
												<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$li.<span style="color: #660066;">data</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;item.autocomplete&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">option</span> <span style="color: #339933;">==</span> opt<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
													input.<span style="color: #660066;">data</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;autocomplete&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">menu</span>.<span style="color: #660066;">activate</span><span style="color: #009900;">&#40;</span>event<span style="color: #339933;">,</span>$li<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
													<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
												<span style="color: #009900;">&#125;</span>
											<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
										<span style="color: #009900;">&#125;</span>
									<span style="color: #009900;">&#125;</span>
									<span style="color: #006600; font-style: italic;">//ignore all other keystrokes</span>
									<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
									<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
								<span style="color: #009900;">&#125;</span>
					  <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
					.<span style="color: #660066;">autocomplete</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
					    delay<span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span>
					    minLength<span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span>
					    source<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>request<span style="color: #339933;">,</span> response<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> response<span style="color: #009900;">&#40;</span>comboData<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
					    select<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>event<span style="color: #339933;">,</span> ui<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					        ui.<span style="color: #000066; font-weight: bold;">item</span>.<span style="color: #660066;">option</span>.<span style="color: #660066;">selected</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
					        self._trigger<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;selected&quot;</span><span style="color: #339933;">,</span> event<span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
					            <span style="color: #000066; font-weight: bold;">item</span><span style="color: #339933;">:</span> ui.<span style="color: #000066; font-weight: bold;">item</span>.<span style="color: #660066;">option</span>
					        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
					    change<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>event<span style="color: #339933;">,</span> ui<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
							<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>ui.<span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>					
								<span style="color: #003366; font-weight: bold;">var</span> matcher <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> RegExp<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;^&quot;</span> <span style="color: #339933;">+</span> $.<span style="color: #660066;">ui</span>.<span style="color: #660066;">autocomplete</span>.<span style="color: #660066;">escapeRegex</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;$&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;i&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
									valid <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
								select.<span style="color: #660066;">children</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;option&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
									<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">match</span><span style="color: #009900;">&#40;</span>matcher<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
										<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">selected</span> <span style="color: #339933;">=</span> valid <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
										<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
									<span style="color: #009900;">&#125;</span>
								<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
								<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>valid<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
									<span style="color: #006600; font-style: italic;">// remove invalid value, as it didn't match anything</span>
									$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
									select.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
									input.<span style="color: #660066;">data</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;autocomplete&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">term</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">;</span>
									<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
								<span style="color: #009900;">&#125;</span>
							<span style="color: #009900;">&#125;</span>
					    <span style="color: #009900;">&#125;</span>
					<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
					.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;ui-widget ui-widget-content ui-corner-left&quot;</span><span style="color: #009900;">&#41;</span>
					.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> self.<span style="color: #660066;">button</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
					.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;autocompleteopen&quot;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #339933;">,</span> ui<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
						<span style="color: #006600; font-style: italic;">//find the currently selected item and highlight it in the list</span>
						<span style="color: #003366; font-weight: bold;">var</span> opt <span style="color: #339933;">=</span> select.<span style="color: #660066;">children</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;:selected&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
						input.<span style="color: #660066;">data</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;autocomplete&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">widget</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">children</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'li'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>		
							<span style="color: #003366; font-weight: bold;">var</span> $li <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
							<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$li.<span style="color: #660066;">data</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;item.autocomplete&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">option</span> <span style="color: #339933;">==</span> opt<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
								input.<span style="color: #660066;">data</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;autocomplete&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">menu</span>.<span style="color: #660066;">activate</span><span style="color: #009900;">&#40;</span>event<span style="color: #339933;">,</span>$li<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
								<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
							<span style="color: #009900;">&#125;</span>
						<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            input.<span style="color: #660066;">data</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;autocomplete&quot;</span><span style="color: #009900;">&#41;</span>._renderItem <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>ul<span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000066; font-weight: bold;">return</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;li&gt;&lt;/li&gt;&quot;</span><span style="color: #009900;">&#41;</span>
					.<span style="color: #660066;">data</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;item.autocomplete&quot;</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#41;</span>
					.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;a href='#'&gt;&quot;</span> <span style="color: #339933;">+</span> <span style="color: #000066; font-weight: bold;">item</span>.<span style="color: #660066;">label</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;&lt;/a&gt;&quot;</span><span style="color: #009900;">&#41;</span>
					.<span style="color: #660066;">appendTo</span><span style="color: #009900;">&#40;</span>ul<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">button</span> <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;button type='button'&gt;&amp;nbsp;&lt;/button&gt;&quot;</span><span style="color: #009900;">&#41;</span>
					.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;tabIndex&quot;</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span>
					.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;title&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;Show All Items&quot;</span><span style="color: #009900;">&#41;</span>
					.<span style="color: #660066;">insertAfter</span><span style="color: #009900;">&#40;</span>input<span style="color: #009900;">&#41;</span>
					.<span style="color: #660066;">button</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
					    icons<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
					        primary<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;ui-icon-triangle-1-s&quot;</span>
					    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
					    text<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span>
					<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
					.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;ui-corner-all&quot;</span><span style="color: #009900;">&#41;</span>
					.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;ui-corner-right ui-button-icon&quot;</span><span style="color: #009900;">&#41;</span>
					.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					    <span style="color: #006600; font-style: italic;">// close if already visible</span>
					    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>input.<span style="color: #660066;">autocomplete</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;widget&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066; font-weight: bold;">is</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;:visible&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					        input.<span style="color: #660066;">autocomplete</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;close&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					        <span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span>
					    <span style="color: #009900;">&#125;</span>
&nbsp;
					    <span style="color: #006600; font-style: italic;">// pass empty string as value to search for, displaying all results</span>
					    input.<span style="color: #660066;">autocomplete</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;search&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					    input.<span style="color: #000066;">focus</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
&nbsp;
		<span style="color: #006600; font-style: italic;">//allows programmatic selection of combo using the option value</span>
        setValue<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>value<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003366; font-weight: bold;">var</span> $input <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">input</span><span style="color: #339933;">;</span>
            $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;option&quot;</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">element</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> value<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">selected</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
                    $input.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
&nbsp;
        destroy<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">input</span>.<span style="color: #660066;">remove</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">button</span>.<span style="color: #660066;">remove</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">element</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            $.<span style="color: #660066;">Widget</span>.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">destroy</span>.<span style="color: #660066;">call</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The particular functions I tried to add are:</p>
<ul>
<li>Removal of any standard textbox typing characteristics</li>
<li>Typing in the textbox jumps to the item begining with that letter</li>
<li>Hitting the same letter continuously cycles through the items beginning with that letter</li>
<li>Programatically select an item using the value</li>
<li>Retain navigation through list via arrow keys/paging</li>
<li>Opening the list jumps to the selected item</li>
</ul>
<p>Feel free to take it and use it but I am very keen on any improvements that can be made, so please let me know what you think. </p>
<p>I know that performance is a bit of a problem with large lists but stopping autocomplete from rebuilding the list each time it is displayed is a little tricky and would mean changing more of it&#8217;s private functions &#8211; something I was hoping to avoid. Suggestions welcome.</p>
<p>*Edit: I totally had my terminology messed up. I was calling my control a combobox which it absolutely isnt. It is a dropdown list, so I have updated the post to reflect that. *places dunce hat on*</p>
]]></content:encoded>
			<wfw:commentRss>http://www.onemoretake.com/2011/04/17/a-better-jquery-ui-combo-box/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Git Extensions Quick Tip – Updating remotes</title>
		<link>http://www.onemoretake.com/2011/02/21/git-extensions-updating-remotes/</link>
		<comments>http://www.onemoretake.com/2011/02/21/git-extensions-updating-remotes/#comments</comments>
		<pubDate>Tue, 22 Feb 2011 07:05:45 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.onemoretake.com/?p=357</guid>
		<description><![CDATA[I have both a desktop and a laptop that I work on and use Git Extensions. Every so often I create a branch on one machine, commit it and then push it to my remote origin. My problem is that when I boot up my other machine, I can never remember how to see that [...]]]></description>
			<content:encoded><![CDATA[<p>I have both a desktop and a laptop that I work on and use Git Extensions. Every so often I create a branch on one machine, commit it and then push it to my remote origin. My problem is that when I boot up my other machine, I can never remember how to see that new branch on the origin in order to pull it down and continue working on it. So mainly for my benefit, here are two different ways to do it:</p>
<ol>
<li>Open up a git bash and type &#8216;git fetch&#8217;  or&#8230;</li>
<li>Click on Remotes->manage remote repositories, click on the Default Pull Behaviour tab, click Update all remote branch</li>
</ol>
<p>Its a little bit hidden away in the Git Extension UI, so thats probably why I have so much of a problem finding it.</p>
<p><a href="http://www.onemoretake.com/wp-content/uploads/2011/02/updateremote.jpg"><img src="http://www.onemoretake.com/wp-content/uploads/2011/02/updateremote-300x120.jpg" alt="Update remote repositories" title="Update remote repositories" width="300" height="120" class="alignnone size-medium wp-image-358" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.onemoretake.com/2011/02/21/git-extensions-updating-remotes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using a Resource File for NHibernate Validation Messages</title>
		<link>http://www.onemoretake.com/2010/11/19/resource-file-nhibernate-validation/</link>
		<comments>http://www.onemoretake.com/2010/11/19/resource-file-nhibernate-validation/#comments</comments>
		<pubDate>Sat, 20 Nov 2010 06:15:39 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[nhibernate]]></category>
		<category><![CDATA[resource files]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://www.onemoretake.com/?p=344</guid>
		<description><![CDATA[I have recently started using NHibernate for a project because I wanted something that would work in Mono on linux and coupled with Fluent NHibernate, seemed like the best choice to work with MySql. It wasn&#8217;t long before I began to use the NHibernate Validator framework to provide some validation on my models. Using it [...]]]></description>
			<content:encoded><![CDATA[<p>I have recently started using NHibernate for a project because I wanted something that would work in Mono on linux and coupled with Fluent NHibernate, seemed like the best choice to work with MySql. </p>
<p>It wasn&#8217;t long before I began to use the NHibernate Validator framework to provide some validation on my models. Using it is similar to Data Annotation Validators which I had used in another project and I liked the way you could use resource files to provide the error messages the Data Annotation Validators produce.</p>
<p>It seemed to take me ages to figure out the equivalent in the NHibernate Validator framework, as I had to piece it together from several other articles which talked about various customizations that could be done. In the end it turns out that its not very difficult to do at all. Here&#8217;s how:</p>
<p>Firstly, when validating your models, you need to point the validation engine to your resource file in the configuration:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008080; font-style: italic;">//create engine</span>
var engine <span style="color: #008000;">=</span>  <span style="color: #008000;">new</span> ValidatorEngine<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #008080; font-style: italic;">//configure and add resource file</span>
var configure <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> FluentConfiguration<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
configure<span style="color: #008000;">.</span><span style="color: #0000FF;">SetCustomResourceManager</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;My.Website.Resources.ValidationMessages&quot;</span>, Assembly<span style="color: #008000;">.</span><span style="color: #0000FF;">Load</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;MyWebsite&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
engine<span style="color: #008000;">.</span><span style="color: #0000FF;">Configure</span><span style="color: #008000;">&#40;</span>configure<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #008080; font-style: italic;">//engine configured, now you can validate</span>
var errors <span style="color: #008000;">=</span> engine<span style="color: #008000;">.</span><span style="color: #0000FF;">Validate</span><span style="color: #008000;">&#40;</span>myentity<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<p>To specifiy which resource value to use, you specify the resource key in the attribute wrapped in curly brackets as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">&nbsp;
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> MyEntity <span style="color: #008000;">&#123;</span>
&nbsp;
  <span style="color: #008000;">&#91;</span>NotNullNotEmpty<span style="color: #008000;">&#40;</span>Message <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;{ResourceKeyWithCurlyBrackets}&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#93;</span>
  <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> SomeProperty <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>&#8230;and thats all there is to it, the text in the resource file should appear in the validation results.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.onemoretake.com/2010/11/19/resource-file-nhibernate-validation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CodeIgniter Snippets for Visual Studio</title>
		<link>http://www.onemoretake.com/2010/07/19/codeigniter-snippets-for-visual-studio/</link>
		<comments>http://www.onemoretake.com/2010/07/19/codeigniter-snippets-for-visual-studio/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 08:28:37 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[vs.php]]></category>

		<guid isPermaLink="false">http://www.onemoretake.com/?p=336</guid>
		<description><![CDATA[I thought I would share something I have been using for quite a while now and find incredibly useful. They are two snippets for Visual Studio that create the standard file start and file end for php files in the codeigniter framework. If you are not sure what I mean then check out the files [...]]]></description>
			<content:encoded><![CDATA[<p>I thought I would share something I have been using for quite a while now and find incredibly useful. They are two snippets for Visual Studio that create the standard file start and file end for php files in the <a href="http://codeigniter.com">codeigniter framework</a>. If you are not sure what I mean then check out the files that make up the framework &#8211; you will notice that they all tend to start with:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">defined</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'BASEPATH'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #990000;">exit</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'No direct script access allowed'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>and end with:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">/* End of file MyFile.php */</span>
<span style="color: #666666; font-style: italic;">/* Location: ./path/to/file/MyFile.php */</span></pre></div></div>

<p>The line at the start of the file is a security measure to stop files being executed outside the framework, whilst the end is just informative but useful anyhow.</p>
<p>I like to do the same thing with all the files I create for my applications but found the typing tedious and because I use the <a href="http://jcxsoftware.com/">VS.php</a> in Visual Studio, I decided to write a couple of snippets to do it for me. </p>
<p>If you are not familiar with snippets in Visual Studio or how to get the following xml to work as a snippet, you can <a href="http://msdn.microsoft.com/en-us/library/ms165392%28VS.80%29.aspx">read all about then on msdn</a>. Anyhow, without further ado, here they are:</p>
<p>filestart.snippet:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;CodeSnippets</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;CodeSnippet</span> <span style="color: #000066;">Format</span>=<span style="color: #ff0000;">&quot;1.0.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Header<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>filestart<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Author<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Dan Sargeant<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Author<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>CodeIgniter File start to stop direct script access<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;HelpUrl<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/HelpUrl<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SnippetTypes<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SnippetType<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Expansion<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/SnippetType<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SnippetType<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>SurroundsWith<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/SnippetType<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/SnippetTypes<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Shortcut<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>filestart<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Shortcut<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Header<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Snippet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Code</span> <span style="color: #000066;">Language</span>=<span style="color: #ff0000;">&quot;PHP&quot;</span> <span style="color: #000066;">Kind</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">Delimiter</span>=<span style="color: #ff0000;">&quot;$&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #339933;">&lt;![CDATA[&lt;?php  if (!defined('BASEPATH')) exit('No direct script access allowed');</span>
<span style="color: #339933;">]]&gt;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Code<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Snippet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/CodeSnippet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/CodeSnippets<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>fileend.snippet:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;CodeSnippets</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;CodeSnippet</span> <span style="color: #000066;">Format</span>=<span style="color: #ff0000;">&quot;1.0.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Header<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>fileend<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Author<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Dan Sargeant<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Author<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>CodeIgniter file ending<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Shortcut<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>fileend<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Shortcut<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SnippetTypes<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SnippetType<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Expansion<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/SnippetType<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SnippetType<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>SurroundsWith<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/SnippetType<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/SnippetTypes<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Header<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Snippet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Declarations<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Literal<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ID<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>filename<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ID<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ToolTip<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Filename<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ToolTip<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Default<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>myfile.php<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Default<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Literal<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Literal<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ID<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>directory<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ID<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ToolTip<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Directory<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ToolTip<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Default<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>models<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Default<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Literal<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Declarations<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Code</span> <span style="color: #000066;">Language</span>=<span style="color: #ff0000;">&quot;PHP&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #339933;">&lt;![CDATA[</span>
<span style="color: #339933;">/* End of file $filename$*/</span>
<span style="color: #339933;">/* Location: ./application/$directory$/$filename$*/]]&gt;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Code<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Snippet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/CodeSnippet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/CodeSnippets<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.onemoretake.com/2010/07/19/codeigniter-snippets-for-visual-studio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convert to Apple Lossless Codec: The Easy Way</title>
		<link>http://www.onemoretake.com/2010/07/02/convert-to-apple-lossless-codec/</link>
		<comments>http://www.onemoretake.com/2010/07/02/convert-to-apple-lossless-codec/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 12:47:46 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[alac]]></category>
		<category><![CDATA[ape]]></category>
		<category><![CDATA[codecs]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[flac]]></category>

		<guid isPermaLink="false">http://www.onemoretake.com/?p=331</guid>
		<description><![CDATA[Playing lossless codecs like APE or FLAC in itunes or on your iphone is not so easy as there is no native support for them. Converting them to the Apple equivalent is also quite tricky. Many people recommend installing media players that support this conversion or purchasing a commercial product to do it. However, there [...]]]></description>
			<content:encoded><![CDATA[<p>Playing lossless codecs like APE or FLAC in itunes or on your iphone is not so easy as there is no native support for them. Converting them to the Apple equivalent is also quite tricky. Many people recommend installing media players that support this conversion or purchasing a commercial product to do it. However, there is a free and easy way to convert your files in Windows that does not require any installation.</p>
<p>The key to it is the use of the <a href="http://ffmpeg.arrozcru.org/autobuilds/">windows port of ffmpeg</a>. It can convert just about anything to anything. However, it is a command line tool and converts one file at a time which means a lot of typing if you want to convert an entire album. I spent a little time the other day figuring out a small batch file that can be used to convert and entire albumn in on go. I thought I&#8217;d share it with you. Just create a file called say, <em>convert.bat</em> and place one of the following in it:</p>
<p>For Monkey&#8217;s Audio APE files:</p>

<div class="wp_syntax"><div class="code"><pre class="dos" style="font-family:monospace;"><span style="color: #00b100; font-weight: bold;">for</span> /f &quot;tokens=*&quot; <span style="color: #33cc33;">%%</span><span style="color: #448888;">a</span> <span style="color: #00b100; font-weight: bold;">IN</span> <span style="color: #33cc33;">(</span>'<span style="color: #b1b100; font-weight: bold;">dir</span> /b *.ape'<span style="color: #33cc33;">)</span> <span style="color: #00b100; font-weight: bold;">do</span> <span style="color: #00b100; font-weight: bold;">call</span> ffmpeg -i &quot;<span style="color: #33cc33;">%</span><span style="color: #33cc33;">%</span>~na<span style="color: #33cc33;">%</span><span style="color: #33cc33;">%</span>~xa&quot; -acodec alac &quot;<span style="color: #33cc33;">%</span><span style="color: #33cc33;">%</span>~na.m4a&quot;</pre></div></div>

<p>For FLAC files:</p>

<div class="wp_syntax"><div class="code"><pre class="dos" style="font-family:monospace;"><span style="color: #00b100; font-weight: bold;">for</span> /f &quot;tokens=*&quot; <span style="color: #33cc33;">%%</span><span style="color: #448888;">a</span> <span style="color: #00b100; font-weight: bold;">IN</span> <span style="color: #33cc33;">(</span>'<span style="color: #b1b100; font-weight: bold;">dir</span> /b *.flac'<span style="color: #33cc33;">)</span> <span style="color: #00b100; font-weight: bold;">do</span> <span style="color: #00b100; font-weight: bold;">call</span> ffmpeg -i &quot;<span style="color: #33cc33;">%</span><span style="color: #33cc33;">%</span>~na<span style="color: #33cc33;">%</span><span style="color: #33cc33;">%</span>~xa&quot; -acodec alac &quot;<span style="color: #33cc33;">%</span><span style="color: #33cc33;">%</span>~na.m4a&quot;</pre></div></div>

<p>Then all you have to do is place your batch file, along with ffmpeg.exe into the directory that contains the files you want to convert and run the batch file. It will convert every file in the directory to apple lossless. Easy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.onemoretake.com/2010/07/02/convert-to-apple-lossless-codec/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Beyond Compare 3 With Git Extensions</title>
		<link>http://www.onemoretake.com/2010/06/27/beyond-compare-3-with-git-extensions/</link>
		<comments>http://www.onemoretake.com/2010/06/27/beyond-compare-3-with-git-extensions/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 10:08:29 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.onemoretake.com/?p=328</guid>
		<description><![CDATA[It seems I have gained a reputation amongst my peers to be a diff tool hopper. That is, I am on a quest to find the perfect diff tool for my development. I think I have given just about every free tool out there a good run for it&#8217;s money and tend to move to [...]]]></description>
			<content:encoded><![CDATA[<p>It seems I have gained a reputation amongst my peers to be a diff tool hopper. That is, I am on a quest to find the perfect diff tool for my development. I think I have given just about every free tool out there a good run for it&#8217;s money and tend to move to the next one when I find myself in a situation that the current tool cannot cope with.</p>
<p>After exhausting all the free options, I made the shift to the commercial tool <a href="http://www.scootersoftware.com/moreinfo.php">Beyond Compare 3</a> a few weeks ago and have not looked back since. So far, it has been awesome. Slick, easy to understand the differences and the pro version even does the three way merging needed for git.</p>
<p>I spend most of my development time, be it C#, VB, PHP or Javascript in the visual studio environment and so when I use git for source control, <a href="http://code.google.com/p/gitextensions/">git extensions</a> is essential. Making both git extensions and Beyond Compare work together is a little bit of trail and error as the very informative <a href="http://www.scootersoftware.com/support.php?zz=kb_vcs">source control support page</a> only covers configuring git via the bash. So to save myself the brain ache again and perhaps to help others, I jot these settings down:</p>
<p><strong>Under Global Settings:</strong></p>
<p>Merge tool: BCompare<br />
Path to mergetool: C:/Path/To/BComp.exe<br />
Mergetool command: &#8220;C:/Path/To/BComp.exe&#8221; &#8220;$LOCAL&#8221; &#8220;$REMOTE&#8221; &#8220;$BASE&#8221; &#8220;$MERGED&#8221;</p>
<p>Diff tool: BCompare<br />
Path to difftool: C:/Path/To/BComp.exe<br />
Difftool command: &#8220;C:/Path/To/BComp.exe&#8221; &#8220;$LOCAL&#8221; &#8220;$REMOTE&#8221;</p>
<p>Make sure you dont override the tool in the local settings or if you want to set it to BCompare.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.onemoretake.com/2010/06/27/beyond-compare-3-with-git-extensions/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>CodeIgniter: Using set_value with Form Posts</title>
		<link>http://www.onemoretake.com/2010/06/21/codeigniter-setvalue-form-posts/</link>
		<comments>http://www.onemoretake.com/2010/06/21/codeigniter-setvalue-form-posts/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 10:01:26 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[helpers]]></category>

		<guid isPermaLink="false">http://www.onemoretake.com/?p=323</guid>
		<description><![CDATA[Today I came across an interesting bug in a codeigniter application I was working on where I encoded ampersands (&#038;amp) were appearing in a report. I did some rudimentary debugging and realised that for some reason, values from a form were being saved to the database html encoded. I stepped through the code and discovered [...]]]></description>
			<content:encoded><![CDATA[<p>Today I came across an interesting bug in a codeigniter application I was working on where I encoded ampersands (&#038;amp) were appearing in a report. I did some rudimentary debugging and realised that for some reason, values from a form were being saved to the database html encoded.</p>
<p>I stepped through the code and discovered that I was using the <a href="http://codeigniter.com/user_guide/helpers/form_helper.html">set_value()</a> function to retrieve the value posted from the form. This is a no-go I&#8217;m afraid. set_value is supposed to be used to set the values of inputs and textareas in forms within the view itself and as such runs the <a href="http://php.net/manual/en/function.htmlspecialchars.php">htmlspecialchars</a> function across the form post value before returning it. There is a function specifically designed for what I wanted: <a href="http://codeigniter.com/user_guide/libraries/input.html">$this->input-post(fieldname)</a>. Lesson learned.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.onemoretake.com/2010/06/21/codeigniter-setvalue-form-posts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Migrating from SVN to Git on MediaTemple (gs)</title>
		<link>http://www.onemoretake.com/2010/04/02/migrating-from-svn-to-git-on-mediatemple/</link>
		<comments>http://www.onemoretake.com/2010/04/02/migrating-from-svn-to-git-on-mediatemple/#comments</comments>
		<pubDate>Sat, 03 Apr 2010 01:06:52 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[mediatemple]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.onemoretake.com/?p=314</guid>
		<description><![CDATA[After seeing a video on using Mecurial on Codeplex I finally took the plunge into distribute revision control. Although Mercurial seemed to have better integration with Visual Studio, which is my main IDE, I decided to use Git instead. This decision was based purely on a gut feeling about which would be the best choice [...]]]></description>
			<content:encoded><![CDATA[<p>After seeing a video on using <a href="http://tekpub.com/codeplex" target="_blank">Mecurial on Codeplex</a> I finally took the plunge into distribute revision control. Although Mercurial seemed to have better integration with Visual Studio, which is my main IDE, I decided to use Git instead. This decision was based purely on a gut feeling about which would be the best choice in the long run. If its good enough to write Linux with, it’s good enough for me.</p>
<p>The shift from SVN to Git was surprisingly easier than I expected. I remember SVN being a little frustrating to get going when I first started with that and was expecting a similar experience, especially when I was trying to shift a couple of in-progress projects from one to the other. What I did find however, is that the guides out there, although pretty good, did not quite match what I wanted to do. I thought I would jot it down so I don’t forget when I need to go it again. Its all done by logging into your server using putty or whatever your ssh client is. Lets jump straight in:</p>
<p>Git is installed on the (gs) so we can get straight into it. Firstly create a directly where you would like to keep your repositories:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span><span style="color: #666666; font-style: italic;">#####/data/git</span></pre></div></div>

<p>Next create a temporary directory to store the git-svn export of your svn repository:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span><span style="color: #666666; font-style: italic;">#####/data/git/myapp_tmp</span></pre></div></div>

<p>Next, create a text file (users.txt) to map your svn users to you git users. It should contain something like:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mysvnuser1 = Git User1 <span style="color: #000000; font-weight: bold;">&lt;</span>gituser1<span style="color: #000000; font-weight: bold;">@</span>mysite.com<span style="color: #000000; font-weight: bold;">&gt;</span>
mysvnuser2 = Git User2  <span style="color: #000000; font-weight: bold;">&lt;</span>gituser2<span style="color: #000000; font-weight: bold;">@</span>mysite.com<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p>I saved mine to the /home/#####/data/git/ directory.</p>
<p>Next we initialise our git repository, ready to import the svn repository:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">git-svn</span> init <span style="color: #c20cb9; font-weight: bold;">file</span>:<span style="color: #000000; font-weight: bold;">///</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>svnrepo<span style="color: #000000; font-weight: bold;">/</span>myapp<span style="color: #000000; font-weight: bold;">/</span>trunk<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">--no-metadata</span></pre></div></div>

<p>Note that I use the file:// notation to specify a local path to where my svn repository is kept. In my case it was /home/#####/data/svnrepo/ but it depends on how you set yours up. The no-metadata flag just ensures that only the information we need is transferred. We then need to setup our user mapping file:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">git</span> config svn.authorsfile <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span><span style="color: #666666; font-style: italic;">#####/data/git/users.txt</span></pre></div></div>

<p>Now for the money shot, we import the data from svn:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">git-svn</span> fetch</pre></div></div>

<p>All going well, your svn repository and all the history should have been imported into your git repository.</p>
<p>The final steps are done in order to tidy up your new git repository so that it is just a standard git repository, without all the svn associations. We remove the svn assocations by cloning it:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">git</span> clone myapp_tmp myapp.git</pre></div></div>

<p>This gives you a myapp.git directory with the actual repository (everything in the .git directory) as well as your working files. As this is on the server, you do not need all the working files, just everything in the .git directory. We can fix that as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> myapp.git
<span style="color: #c20cb9; font-weight: bold;">mv</span> .git .. <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-fr</span> <span style="color: #000000; font-weight: bold;">*</span>
<span style="color: #c20cb9; font-weight: bold;">mv</span> ..<span style="color: #000000; font-weight: bold;">/</span>.git .
<span style="color: #c20cb9; font-weight: bold;">mv</span> .git<span style="color: #000000; font-weight: bold;">/*</span> .
<span style="color: #c20cb9; font-weight: bold;">rmdir</span> .git
<span style="color: #c20cb9; font-weight: bold;">git</span> config <span style="color: #660033;">--bool</span> core.bare <span style="color: #c20cb9; font-weight: bold;">true</span></pre></div></div>

<p>Most of those commands just move everything out of the .git directory and remove the working files. The final command however marks the repository as a bare repository, i.e. one without the working files.</p>
<p>Thats it. You should now have a git repository on your server that you can clone to your development machine and begin work.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.onemoretake.com/2010/04/02/migrating-from-svn-to-git-on-mediatemple/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss><!-- Dynamic page generated in 1.243 seconds. --><!-- Cached page generated by WP-Super-Cache on 2012-05-09 00:11:43 -->

