<?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>Tue, 20 Jul 2010 08:28:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</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>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>



<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=CodeIgniter+Snippets+for+Visual+Studio+-+&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.onemoretake.com/2010/07/19/codeigniter-snippets-for-visual-studio/&amp;t=CodeIgniter+Snippets+for+Visual+Studio" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.onemoretake.com/2010/07/19/codeigniter-snippets-for-visual-studio/&amp;title=CodeIgniter+Snippets+for+Visual+Studio" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.onemoretake.com/2010/07/19/codeigniter-snippets-for-visual-studio/&amp;title=CodeIgniter+Snippets+for+Visual+Studio&amp;summary=I%20thought%20I%20would%20share%20something%20I%20have%20been%20using%20for%20quite%20a%20while%20now%20and%20find%20incredibly%20useful.%20They%20are%20two%20snippets%20for%20Visual%20Studio%20that%20create%20the%20standard%20file%20start%20and%20file%20end%20for%20php%20files%20in%20the%20codeigniter%20framework.%20If%20you%20are%20not%20sure%20what%20I%20mean%20then%20check%20out%20the%20files%20that%20mak&amp;source=onemoretake" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.onemoretake.com/2010/07/19/codeigniter-snippets-for-visual-studio/&amp;title=CodeIgniter+Snippets+for+Visual+Studio" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-blinklist">
			<a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http://www.onemoretake.com/2010/07/19/codeigniter-snippets-for-visual-studio/&amp;Title=CodeIgniter+Snippets+for+Visual+Studio" rel="nofollow" class="external" title="Share this on Blinklist">Share this on Blinklist</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.onemoretake.com/2010/07/19/codeigniter-snippets-for-visual-studio/&amp;title=CodeIgniter+Snippets+for+Visual+Studio" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-hackernews">
			<a href="http://news.ycombinator.com/submitlink?u=http://www.onemoretake.com/2010/07/19/codeigniter-snippets-for-visual-studio/&amp;t=CodeIgniter+Snippets+for+Visual+Studio" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.onemoretake.com/2010/07/19/codeigniter-snippets-for-visual-studio/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.onemoretake.com/2010/07/19/codeigniter-snippets-for-visual-studio/&amp;title=CodeIgniter+Snippets+for+Visual+Studio" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.onemoretake.com/2010/07/19/codeigniter-snippets-for-visual-studio/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22CodeIgniter%20Snippets%20for%20Visual%20Studio%22&amp;body=Link: http://www.onemoretake.com/2010/07/19/codeigniter-snippets-for-visual-studio/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A I%20thought%20I%20would%20share%20something%20I%20have%20been%20using%20for%20quite%20a%20while%20now%20and%20find%20incredibly%20useful.%20They%20are%20two%20snippets%20for%20Visual%20Studio%20that%20create%20the%20standard%20file%20start%20and%20file%20end%20for%20php%20files%20in%20the%20codeigniter%20framework.%20If%20you%20are%20not%20sure%20what%20I%20mean%20then%20check%20out%20the%20files%20that%20mak" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
</ul>
<div style="clear:both;"></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: #66cc66;">&#40;</span>'<span style="color: #b1b100; font-weight: bold;">dir</span> /b *.ape'<span style="color: #66cc66;">&#41;</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: #66cc66;">&#40;</span>'<span style="color: #b1b100; font-weight: bold;">dir</span> /b *.flac'<span style="color: #66cc66;">&#41;</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>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Convert+to+Apple+Lossless+Codec%3A+The+Easy+Way+-+&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.onemoretake.com/2010/07/02/convert-to-apple-lossless-codec/&amp;t=Convert+to+Apple+Lossless+Codec%3A+The+Easy+Way" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.onemoretake.com/2010/07/02/convert-to-apple-lossless-codec/&amp;title=Convert+to+Apple+Lossless+Codec%3A+The+Easy+Way" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.onemoretake.com/2010/07/02/convert-to-apple-lossless-codec/&amp;title=Convert+to+Apple+Lossless+Codec%3A+The+Easy+Way&amp;summary=Playing%20lossless%20codecs%20like%20APE%20or%20FLAC%20in%20itunes%20or%20on%20your%20iphone%20is%20not%20so%20easy%20as%20there%20is%20no%20native%20support%20for%20them.%20Converting%20them%20to%20the%20Apple%20equivalent%20is%20also%20quite%20tricky.%20Many%20people%20recommend%20installing%20media%20players%20that%20support%20this%20conversion%20or%20purchasing%20a%20commercial%20product%20to%20&amp;source=onemoretake" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.onemoretake.com/2010/07/02/convert-to-apple-lossless-codec/&amp;title=Convert+to+Apple+Lossless+Codec%3A+The+Easy+Way" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-blinklist">
			<a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http://www.onemoretake.com/2010/07/02/convert-to-apple-lossless-codec/&amp;Title=Convert+to+Apple+Lossless+Codec%3A+The+Easy+Way" rel="nofollow" class="external" title="Share this on Blinklist">Share this on Blinklist</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.onemoretake.com/2010/07/02/convert-to-apple-lossless-codec/&amp;title=Convert+to+Apple+Lossless+Codec%3A+The+Easy+Way" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-hackernews">
			<a href="http://news.ycombinator.com/submitlink?u=http://www.onemoretake.com/2010/07/02/convert-to-apple-lossless-codec/&amp;t=Convert+to+Apple+Lossless+Codec%3A+The+Easy+Way" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.onemoretake.com/2010/07/02/convert-to-apple-lossless-codec/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.onemoretake.com/2010/07/02/convert-to-apple-lossless-codec/&amp;title=Convert+to+Apple+Lossless+Codec%3A+The+Easy+Way" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.onemoretake.com/2010/07/02/convert-to-apple-lossless-codec/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22Convert%20to%20Apple%20Lossless%20Codec%3A%20The%20Easy%20Way%22&amp;body=Link: http://www.onemoretake.com/2010/07/02/convert-to-apple-lossless-codec/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A Playing%20lossless%20codecs%20like%20APE%20or%20FLAC%20in%20itunes%20or%20on%20your%20iphone%20is%20not%20so%20easy%20as%20there%20is%20no%20native%20support%20for%20them.%20Converting%20them%20to%20the%20Apple%20equivalent%20is%20also%20quite%20tricky.%20Many%20people%20recommend%20installing%20media%20players%20that%20support%20this%20conversion%20or%20purchasing%20a%20commercial%20product%20to%20" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></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>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Using+Beyond+Compare+3+With+Git+Extensions+-+&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.onemoretake.com/2010/06/27/beyond-compare-3-with-git-extensions/&amp;t=Using+Beyond+Compare+3+With+Git+Extensions" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.onemoretake.com/2010/06/27/beyond-compare-3-with-git-extensions/&amp;title=Using+Beyond+Compare+3+With+Git+Extensions" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.onemoretake.com/2010/06/27/beyond-compare-3-with-git-extensions/&amp;title=Using+Beyond+Compare+3+With+Git+Extensions&amp;summary=It%20seems%20I%20have%20gained%20a%20reputation%20amongst%20my%20peers%20to%20be%20a%20diff%20tool%20hopper.%20That%20is%2C%20I%20am%20on%20a%20quest%20to%20find%20the%20perfect%20diff%20tool%20for%20my%20development.%20I%20think%20I%20have%20given%20just%20about%20every%20free%20tool%20out%20there%20a%20good%20run%20for%20it%27s%20money%20and%20tend%20to%20move%20to%20the%20next%20one%20when%20I%20find%20myself%20in%20a%20situa&amp;source=onemoretake" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.onemoretake.com/2010/06/27/beyond-compare-3-with-git-extensions/&amp;title=Using+Beyond+Compare+3+With+Git+Extensions" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-blinklist">
			<a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http://www.onemoretake.com/2010/06/27/beyond-compare-3-with-git-extensions/&amp;Title=Using+Beyond+Compare+3+With+Git+Extensions" rel="nofollow" class="external" title="Share this on Blinklist">Share this on Blinklist</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.onemoretake.com/2010/06/27/beyond-compare-3-with-git-extensions/&amp;title=Using+Beyond+Compare+3+With+Git+Extensions" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-hackernews">
			<a href="http://news.ycombinator.com/submitlink?u=http://www.onemoretake.com/2010/06/27/beyond-compare-3-with-git-extensions/&amp;t=Using+Beyond+Compare+3+With+Git+Extensions" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.onemoretake.com/2010/06/27/beyond-compare-3-with-git-extensions/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.onemoretake.com/2010/06/27/beyond-compare-3-with-git-extensions/&amp;title=Using+Beyond+Compare+3+With+Git+Extensions" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.onemoretake.com/2010/06/27/beyond-compare-3-with-git-extensions/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22Using%20Beyond%20Compare%203%20With%20Git%20Extensions%22&amp;body=Link: http://www.onemoretake.com/2010/06/27/beyond-compare-3-with-git-extensions/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A It%20seems%20I%20have%20gained%20a%20reputation%20amongst%20my%20peers%20to%20be%20a%20diff%20tool%20hopper.%20That%20is%2C%20I%20am%20on%20a%20quest%20to%20find%20the%20perfect%20diff%20tool%20for%20my%20development.%20I%20think%20I%20have%20given%20just%20about%20every%20free%20tool%20out%20there%20a%20good%20run%20for%20it%27s%20money%20and%20tend%20to%20move%20to%20the%20next%20one%20when%20I%20find%20myself%20in%20a%20situa" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.onemoretake.com/2010/06/27/beyond-compare-3-with-git-extensions/feed/</wfw:commentRss>
		<slash:comments>3</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>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=CodeIgniter%3A+Using+set_value+with+Form+Posts+-+&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.onemoretake.com/2010/06/21/codeigniter-setvalue-form-posts/&amp;t=CodeIgniter%3A+Using+set_value+with+Form+Posts" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.onemoretake.com/2010/06/21/codeigniter-setvalue-form-posts/&amp;title=CodeIgniter%3A+Using+set_value+with+Form+Posts" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.onemoretake.com/2010/06/21/codeigniter-setvalue-form-posts/&amp;title=CodeIgniter%3A+Using+set_value+with+Form+Posts&amp;summary=Today%20I%20came%20across%20an%20interesting%20bug%20in%20a%20codeigniter%20application%20I%20was%20working%20on%20where%20I%20encoded%20ampersands%20%28%26amp%29%20were%20appearing%20in%20a%20report.%20I%20did%20some%20rudimentary%20debugging%20and%20realised%20that%20for%20some%20reason%2C%20values%20from%20a%20form%20were%20being%20saved%20to%20the%20database%20html%20encoded.%0D%0A%0D%0AI%20stepped%20throug&amp;source=onemoretake" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.onemoretake.com/2010/06/21/codeigniter-setvalue-form-posts/&amp;title=CodeIgniter%3A+Using+set_value+with+Form+Posts" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-blinklist">
			<a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http://www.onemoretake.com/2010/06/21/codeigniter-setvalue-form-posts/&amp;Title=CodeIgniter%3A+Using+set_value+with+Form+Posts" rel="nofollow" class="external" title="Share this on Blinklist">Share this on Blinklist</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.onemoretake.com/2010/06/21/codeigniter-setvalue-form-posts/&amp;title=CodeIgniter%3A+Using+set_value+with+Form+Posts" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-hackernews">
			<a href="http://news.ycombinator.com/submitlink?u=http://www.onemoretake.com/2010/06/21/codeigniter-setvalue-form-posts/&amp;t=CodeIgniter%3A+Using+set_value+with+Form+Posts" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.onemoretake.com/2010/06/21/codeigniter-setvalue-form-posts/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.onemoretake.com/2010/06/21/codeigniter-setvalue-form-posts/&amp;title=CodeIgniter%3A+Using+set_value+with+Form+Posts" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.onemoretake.com/2010/06/21/codeigniter-setvalue-form-posts/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22CodeIgniter%3A%20Using%20set_value%20with%20Form%20Posts%22&amp;body=Link: http://www.onemoretake.com/2010/06/21/codeigniter-setvalue-form-posts/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A Today%20I%20came%20across%20an%20interesting%20bug%20in%20a%20codeigniter%20application%20I%20was%20working%20on%20where%20I%20encoded%20ampersands%20%28%26amp%29%20were%20appearing%20in%20a%20report.%20I%20did%20some%20rudimentary%20debugging%20and%20realised%20that%20for%20some%20reason%2C%20values%20from%20a%20form%20were%20being%20saved%20to%20the%20database%20html%20encoded.%0D%0A%0D%0AI%20stepped%20throug" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.onemoretake.com/2010/06/21/codeigniter-setvalue-form-posts/feed/</wfw:commentRss>
		<slash:comments>0</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;">git-svn 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;">git 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;">git-svn 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;">git 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
git 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>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Migrating+from+SVN+to+Git+on+MediaTemple+%28gs%29+-+&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.onemoretake.com/2010/04/02/migrating-from-svn-to-git-on-mediatemple/&amp;t=Migrating+from+SVN+to+Git+on+MediaTemple+%28gs%29" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.onemoretake.com/2010/04/02/migrating-from-svn-to-git-on-mediatemple/&amp;title=Migrating+from+SVN+to+Git+on+MediaTemple+%28gs%29" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.onemoretake.com/2010/04/02/migrating-from-svn-to-git-on-mediatemple/&amp;title=Migrating+from+SVN+to+Git+on+MediaTemple+%28gs%29&amp;summary=After%20seeing%20a%20video%20on%20using%20Mecurial%20on%20Codeplex%20I%20finally%20took%20the%20plunge%20into%20distribute%20revision%20control.%20Although%20Mercurial%20seemed%20to%20have%20better%20integration%20with%20Visual%20Studio%2C%20which%20is%20my%20main%20IDE%2C%20I%20decided%20to%20use%20Git%20instead.%20This%20decision%20was%20based%20purely%20on%20a%20gut%20feeling%20about%20which%20woul&amp;source=onemoretake" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.onemoretake.com/2010/04/02/migrating-from-svn-to-git-on-mediatemple/&amp;title=Migrating+from+SVN+to+Git+on+MediaTemple+%28gs%29" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-blinklist">
			<a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http://www.onemoretake.com/2010/04/02/migrating-from-svn-to-git-on-mediatemple/&amp;Title=Migrating+from+SVN+to+Git+on+MediaTemple+%28gs%29" rel="nofollow" class="external" title="Share this on Blinklist">Share this on Blinklist</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.onemoretake.com/2010/04/02/migrating-from-svn-to-git-on-mediatemple/&amp;title=Migrating+from+SVN+to+Git+on+MediaTemple+%28gs%29" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-hackernews">
			<a href="http://news.ycombinator.com/submitlink?u=http://www.onemoretake.com/2010/04/02/migrating-from-svn-to-git-on-mediatemple/&amp;t=Migrating+from+SVN+to+Git+on+MediaTemple+%28gs%29" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.onemoretake.com/2010/04/02/migrating-from-svn-to-git-on-mediatemple/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.onemoretake.com/2010/04/02/migrating-from-svn-to-git-on-mediatemple/&amp;title=Migrating+from+SVN+to+Git+on+MediaTemple+%28gs%29" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.onemoretake.com/2010/04/02/migrating-from-svn-to-git-on-mediatemple/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22Migrating%20from%20SVN%20to%20Git%20on%20MediaTemple%20%28gs%29%22&amp;body=Link: http://www.onemoretake.com/2010/04/02/migrating-from-svn-to-git-on-mediatemple/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A After%20seeing%20a%20video%20on%20using%20Mecurial%20on%20Codeplex%20I%20finally%20took%20the%20plunge%20into%20distribute%20revision%20control.%20Although%20Mercurial%20seemed%20to%20have%20better%20integration%20with%20Visual%20Studio%2C%20which%20is%20my%20main%20IDE%2C%20I%20decided%20to%20use%20Git%20instead.%20This%20decision%20was%20based%20purely%20on%20a%20gut%20feeling%20about%20which%20woul" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></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>
		<item>
		<title>Mocking Session in ASP.NET with Moq and VB.NET</title>
		<link>http://www.onemoretake.com/2010/01/17/mocking-session-in-asp-net-with-moq-and-vb-net/</link>
		<comments>http://www.onemoretake.com/2010/01/17/mocking-session-in-asp-net-with-moq-and-vb-net/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 00:32:04 +0000</pubDate>
		<dc:creator>dan</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Moq]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[Unit Test]]></category>

		<guid isPermaLink="false">http://www.onemoretake.com/?p=302</guid>
		<description><![CDATA[It has been a few years since I have had the chance to explore the latest enhancements to ASP.NET. The development in my day job was locked into traditional ASP.NET forms just before MVC 1.0 was released and there has not been any opportunity to change. TDD, dependency injection and inversion of control containers all [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.onemoretake.com/wp-content/uploads/2010/01/logo.png"><img style="border-right-width: 0px; margin: 0px 10px 10px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="logo" border="0" alt="logo" align="left" src="http://www.onemoretake.com/wp-content/uploads/2010/01/logo_thumb.png" width="123" height="79" /></a> </p>
<p>It has been a few years since I have had the chance to explore the latest enhancements to ASP.NET. The development in my day job was locked into traditional ASP.NET forms just before MVC 1.0 was released and there has not been any opportunity to change. TDD, dependency injection and inversion of control containers all slipped by with me staring at them with my nose pressed against the window. I also develop in php with <a href="http://www.codeigniter.com" target="_blank">CodeIgniter</a>, so I am quite familiar with the idea of MVC and was thoroughly excited when recently, the company I work for, began brewing the idea for a new project. Now was the time to change, so I stocked up on books and blog articles and began the big catch up. I won’t go on about how great MVC is, especially when I spent many hours battling against the web form paradigm &#8211; its such an anti-web way of doing things but with these new ways of working, I now feel a new vigour for .Net web development. </p>
<p>My journey found me working with <a href="http://code.google.com/p/moq/" target="_blank">Moq</a> and although it is pretty self explanatory, most examples and articles are in C# and the documentation for the library is a little sparse. I don’t find the switching between C# and VB.NET very difficult as there is mostly only a syntax difference between them but I did find a problem when, in my unit tests, I needed to assert that entries in the session had been set correctly. So here is how to do it in VB.NET.</p>
<h3>Checking a value has been set in Session</h3>
<p>The first thing that you need is a session object that you can look at in your tests. It needs to inherit from <a href="http://msdn.microsoft.com/en-us/library/system.web.httpsessionstatebase.aspx" target="_blank">HttpSessionStateBase</a> and is pretty simple as the session is just a key-value store &#8211; we can use a generic dictionary to store the values we want to check:</p>

<div class="wp_syntax"><div class="code"><pre class="vbnet" style="font-family:monospace;"><span style="color: #FF8000;">Public</span> <span style="color: #0600FF;">Class</span> HttpSessionMock
    <span style="color: #0600FF;">Inherits</span> HttpSessionStateBase
    <span style="color: #FF8000;">Private</span> <span style="color: #0600FF;">ReadOnly</span> objects <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">New</span> <span style="color: #008000;">Dictionary</span><span style="color: #000000;">&#40;</span>Of <span style="color: #FF8000;">String</span>, <span style="color: #FF0000;">Object</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
&nbsp;
    <span style="color: #0600FF;">Default</span> <span style="color: #FF8000;">Public</span> <span style="color: #FF8000;">Overloads</span> <span style="color: #FF8000;">Overrides</span> <span style="color: #FF8000;">Property</span> Item<span style="color: #000000;">&#40;</span><span style="color: #FF8000;">ByVal</span> name <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">String</span><span style="color: #000000;">&#41;</span> <span style="color: #FF8000;">As</span> <span style="color: #FF0000;">Object</span>
        <span style="color: #FF8000;">Get</span>
            <span style="color: #FF8000;">Return</span> <span style="color: #0600FF;">If</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>objects.<span style="color: #0000FF;">ContainsKey</span><span style="color: #000000;">&#40;</span>name<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>, objects<span style="color: #000000;">&#40;</span>name<span style="color: #000000;">&#41;</span>, <span style="color: #FF8000;">Nothing</span><span style="color: #000000;">&#41;</span>
        <span style="color: #0600FF;">End</span> <span style="color: #FF8000;">Get</span>
        <span style="color: #FF8000;">Set</span><span style="color: #000000;">&#40;</span><span style="color: #FF8000;">ByVal</span> value <span style="color: #FF8000;">As</span> <span style="color: #FF0000;">Object</span><span style="color: #000000;">&#41;</span>
            objects<span style="color: #000000;">&#40;</span>name<span style="color: #000000;">&#41;</span> <span style="color: #008000;">=</span> value
        <span style="color: #0600FF;">End</span> <span style="color: #FF8000;">Set</span>
    <span style="color: #0600FF;">End</span> <span style="color: #FF8000;">Property</span>
&nbsp;
    <span style="color: #FF8000;">Public</span> <span style="color: #FF8000;">Overrides</span> <span style="color: #0600FF;">Sub</span> Add<span style="color: #000000;">&#40;</span><span style="color: #FF8000;">ByVal</span> name <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">String</span>, <span style="color: #FF8000;">ByVal</span> value <span style="color: #FF8000;">As</span> <span style="color: #FF0000;">Object</span><span style="color: #000000;">&#41;</span>
        objects.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span>name, value<span style="color: #000000;">&#41;</span>
    <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span>
<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Class</span></pre></div></div>

<p>So we now have a session store and we can then use Moq to utilise that in our controller during our test. This is done be setting up a controller context:</p>

<div class="wp_syntax"><div class="code"><pre class="vbnet" style="font-family:monospace;"> <span style="color: #008080; font-style: italic;">'Create a real mock session object to check value against</span>
 <span style="color: #0600FF;">Dim</span> session <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">New</span> HttpSessionMock<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
&nbsp;
 <span style="color: #008080; font-style: italic;">'Create a moq controller context</span>
 <span style="color: #0600FF;">Dim</span> mockcontext <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">New</span> Mock<span style="color: #000000;">&#40;</span>Of ControllerContext<span style="color: #000000;">&#41;</span>
&nbsp;
 <span style="color: #008080; font-style: italic;">'Ensure our session object is returned when the session is requested</span>
 mockcontext.<span style="color: #0000FF;">SetupGet</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">Function</span><span style="color: #000000;">&#40;</span>c <span style="color: #FF8000;">As</span> ControllerContext<span style="color: #000000;">&#41;</span> c.<span style="color: #0000FF;">HttpContext</span>.<span style="color: #0000FF;">Session</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Returns</span><span style="color: #000000;">&#40;</span>session<span style="color: #000000;">&#41;</span>
&nbsp;
 <span style="color: #008080; font-style: italic;">'set our controller context to be the moq context</span>
 MyController.<span style="color: #0000FF;">ControllerContext</span> <span style="color: #008000;">=</span> mockcontext.<span style="color: #FF0000;">Object</span></pre></div></div>

<p>We can then run our controller action that sets a value in our mock session object and assert that the correct value is set as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="vbnet" style="font-family:monospace;">  <span style="color: #008080; font-style: italic;">'run the controller action</span>
 <span style="color: #0600FF;">Dim</span> result <span style="color: #008000;">=</span> MyController.<span style="color: #0000FF;">SomeAction</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
&nbsp;
 <span style="color: #008080; font-style: italic;">'assert the session contains the object we expect</span>
 Assert.<span style="color: #0000FF;">IsInstanceOfType</span><span style="color: #000000;">&#40;</span>session.<span style="color: #0000FF;">Item</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;SessionItemToCheck&quot;</span><span style="color: #000000;">&#41;</span>, <span style="color: #804040;">GetType</span><span style="color: #000000;">&#40;</span>ExpectedSessionObject<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
&nbsp;
 <span style="color: #008080; font-style: italic;">'TODO:other tests to ensure session item is correct</span></pre></div></div>

<h3>Ensuring a value is returned from Session</h3>
<p>You can use the above real mock session object to do this in exactly the same way but we can also setup Moq to return a particular value from session directly:</p>

<div class="wp_syntax"><div class="code"><pre class="vbnet" style="font-family:monospace;"><span style="color: #008080; font-style: italic;">'create a test object/value we want session to return</span>
<span style="color: #0600FF;">Dim</span> MySessionValue <span style="color: #FF8000;">as</span> <span style="color: #FF8000;">New</span> SomeObject<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
&nbsp;
<span style="color: #008080; font-style: italic;">'create our moq controller context</span>
<span style="color: #0600FF;">Dim</span> mockcontext <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">New</span> Mock<span style="color: #000000;">&#40;</span>Of ControllerContext<span style="color: #000000;">&#41;</span>
&nbsp;
<span style="color: #008080; font-style: italic;">'ensure our test object gets returned by the moq session</span>
mockcontext.<span style="color: #0000FF;">SetupGet</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">Function</span><span style="color: #000000;">&#40;</span>c <span style="color: #FF8000;">As</span> ControllerContext<span style="color: #000000;">&#41;</span> c.<span style="color: #0000FF;">HttpContext</span>.<span style="color: #0000FF;">Session</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;SessionItemToTest&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Returns</span><span style="color: #000000;">&#40;</span>MySessionValue<span style="color: #000000;">&#41;</span>
&nbsp;
<span style="color: #008080; font-style: italic;">'assign our context to the controller	</span>
controller.<span style="color: #0000FF;">ControllerContext</span> <span style="color: #008000;">=</span> mockcontext.<span style="color: #FF0000;">Object</span>
&nbsp;
<span style="color: #008080; font-style: italic;">'TODO: run controller action and assert results</span></pre></div></div>

<p>When I look at the code now, I realise that it is quite simple to achieve. However, it took me a little while to get my head around Moq and figure this out as all the examples out there seemed to be trying to do so much more than solely testing session state. It confused me anyhow.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Mocking+Session+in+ASP.NET+with+Moq+and+VB.NET+-+&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.onemoretake.com/2010/01/17/mocking-session-in-asp-net-with-moq-and-vb-net/&amp;t=Mocking+Session+in+ASP.NET+with+Moq+and+VB.NET" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.onemoretake.com/2010/01/17/mocking-session-in-asp-net-with-moq-and-vb-net/&amp;title=Mocking+Session+in+ASP.NET+with+Moq+and+VB.NET" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.onemoretake.com/2010/01/17/mocking-session-in-asp-net-with-moq-and-vb-net/&amp;title=Mocking+Session+in+ASP.NET+with+Moq+and+VB.NET&amp;summary=%20%20%20It%20has%20been%20a%20few%20years%20since%20I%20have%20had%20the%20chance%20to%20explore%20the%20latest%20enhancements%20to%20ASP.NET.%20The%20development%20in%20my%20day%20job%20was%20locked%20into%20traditional%20ASP.NET%20forms%20just%20before%20MVC%201.0%20was%20released%20and%20there%20has%20not%20been%20any%20opportunity%20to%20change.%20TDD%2C%20dependency%20injection%20and%20inversion%20of%20&amp;source=onemoretake" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.onemoretake.com/2010/01/17/mocking-session-in-asp-net-with-moq-and-vb-net/&amp;title=Mocking+Session+in+ASP.NET+with+Moq+and+VB.NET" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-blinklist">
			<a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http://www.onemoretake.com/2010/01/17/mocking-session-in-asp-net-with-moq-and-vb-net/&amp;Title=Mocking+Session+in+ASP.NET+with+Moq+and+VB.NET" rel="nofollow" class="external" title="Share this on Blinklist">Share this on Blinklist</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.onemoretake.com/2010/01/17/mocking-session-in-asp-net-with-moq-and-vb-net/&amp;title=Mocking+Session+in+ASP.NET+with+Moq+and+VB.NET" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-hackernews">
			<a href="http://news.ycombinator.com/submitlink?u=http://www.onemoretake.com/2010/01/17/mocking-session-in-asp-net-with-moq-and-vb-net/&amp;t=Mocking+Session+in+ASP.NET+with+Moq+and+VB.NET" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.onemoretake.com/2010/01/17/mocking-session-in-asp-net-with-moq-and-vb-net/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.onemoretake.com/2010/01/17/mocking-session-in-asp-net-with-moq-and-vb-net/&amp;title=Mocking+Session+in+ASP.NET+with+Moq+and+VB.NET" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.onemoretake.com/2010/01/17/mocking-session-in-asp-net-with-moq-and-vb-net/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22Mocking%20Session%20in%20ASP.NET%20with%20Moq%20and%20VB.NET%22&amp;body=Link: http://www.onemoretake.com/2010/01/17/mocking-session-in-asp-net-with-moq-and-vb-net/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A %20%20%20It%20has%20been%20a%20few%20years%20since%20I%20have%20had%20the%20chance%20to%20explore%20the%20latest%20enhancements%20to%20ASP.NET.%20The%20development%20in%20my%20day%20job%20was%20locked%20into%20traditional%20ASP.NET%20forms%20just%20before%20MVC%201.0%20was%20released%20and%20there%20has%20not%20been%20any%20opportunity%20to%20change.%20TDD%2C%20dependency%20injection%20and%20inversion%20of%20" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.onemoretake.com/2010/01/17/mocking-session-in-asp-net-with-moq-and-vb-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AjaxQueue and jQuery 1.3</title>
		<link>http://www.onemoretake.com/2009/10/11/ajaxqueue-and-jquery-1-3/</link>
		<comments>http://www.onemoretake.com/2009/10/11/ajaxqueue-and-jquery-1-3/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 07:43:23 +0000</pubDate>
		<dc:creator>dan</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[ajaxqueue]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.onemoretake.com/?p=291</guid>
		<description><![CDATA[The website that I work on for the majority of my time had been running on the rather out of date jQuery 1.2 for quite some time. I recently found myself with a little bit of downtime and decided it was a good time to see if we could upgrade and take advantage of all [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.onemoretake.com/wp-content/uploads/2009/10/800pxQueue_algorithmn.jpg"><img style="border-bottom: 0px; border-left: 0px; margin: 0px 25px 0px 0px; display: inline; border-top: 0px; border-right: 0px" title="800px-Queue_algorithmn" border="0" alt="800px-Queue_algorithmn" align="left" src="http://www.onemoretake.com/wp-content/uploads/2009/10/800pxQueue_algorithmn_thumb.jpg" width="244" height="106" /></a> The website that I work on for the majority of my time had been running on the rather out of date jQuery 1.2 for quite some time. I recently found myself with a little bit of downtime and decided it was a good time to see if we could upgrade and take advantage of all the speed improvements that the latest version gives us.</p>
<p>On the most part, the upgrade was fairly painless. Most things worked without change but one particular plug-in did not &#8211; <a href="http://plugins.jquery.com/project/ajaxqueue" target="_blank">AjaxQueue</a>. This is a great little control that acts as an add-on to the <a href="http://docs.jquery.com/Ajax" target="_blank">ajax method of jQuery</a>, allowing a little more control over how concurrent calls are processed. It gives three modes of operation but for us, the most useful of these are abort and queue and from the names it is fairly obvious what they do.</p>
<p>After I upgraded to jQuery 1.3, it did not take me long to realise that the queue mode was broken. I briefly looked around for an alternative plug-in but found that all of them would require too much change to our existing controls. There was no alternative, I had to open up the hood of AjaxQueue and see what had gone wrong.</p>
<p>What I found was that there must of been a change to a method that the plug-in relied on – a method that it seemed, only became publicly available in version 1.3 – <a href="http://docs.jquery.com/Core/queue" target="_blank">queue</a>. Although the function was similar, the conclusion that I came to was that prior to version 1.3, the queue function automatically de-queued any function added and processed it. When using the latest jQuery, the ajax calls were queued but there was no code to start the processing of the queue. </p>
<p>It was slightly more complex I thought it would be to get it going &#8211; I had to ensure the queue was only started once. I finally came up with a solution and a newly revived plug-in, the code of which is below. As the original plugin has not been touched for quite some time (2007), I thought it ok to post my modified version here.</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>
&nbsp;
    <span style="color: #003366; font-weight: bold;">var</span> ajax <span style="color: #339933;">=</span> $.<span style="color: #660066;">ajax</span><span style="color: #339933;">,</span>
        pendingRequests <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
        synced <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
        syncedData <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
        ajaxRunning <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
    $.<span style="color: #660066;">ajax</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>settings<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #006600; font-style: italic;">// create settings for compatibility with ajaxSetup</span>
        settings <span style="color: #339933;">=</span> jQuery.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span>settings<span style="color: #339933;">,</span> jQuery.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> jQuery.<span style="color: #660066;">ajaxSettings</span><span style="color: #339933;">,</span> settings<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #003366; font-weight: bold;">var</span> port <span style="color: #339933;">=</span> settings.<span style="color: #660066;">port</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">switch</span> <span style="color: #009900;">&#40;</span>settings.<span style="color: #660066;">mode</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">&quot;abort&quot;</span><span style="color: #339933;">:</span>
                <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>pendingRequests<span style="color: #009900;">&#91;</span>port<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    pendingRequests<span style="color: #009900;">&#91;</span>port<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">abort</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: #000066; font-weight: bold;">return</span> pendingRequests<span style="color: #009900;">&#91;</span>port<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> ajax.<span style="color: #660066;">apply</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span> arguments<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">&quot;queue&quot;</span><span style="color: #339933;">:</span>
                <span style="color: #003366; font-weight: bold;">var</span> _old <span style="color: #339933;">=</span> settings.<span style="color: #660066;">complete</span><span style="color: #339933;">;</span>
                settings.<span style="color: #660066;">complete</span> <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;">if</span> <span style="color: #009900;">&#40;</span>_old<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        _old.<span style="color: #660066;">apply</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span> arguments<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #009900;">&#125;</span>
                    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>ajax<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">queue</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;ajax&quot;</span> <span style="color: #339933;">+</span> port<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        jQuery<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>ajax<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">dequeue</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;ajax&quot;</span> <span style="color: #339933;">+</span> port<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
                        ajaxRunning<span style="color: #009900;">&#91;</span>port<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</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: #339933;">;</span>
&nbsp;
                jQuery<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>ajax<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">queue</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;ajax&quot;</span> <span style="color: #339933;">+</span> port<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>
                    ajax<span style="color: #009900;">&#40;</span>settings<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>jQuery<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>ajax<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">queue</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;ajax&quot;</span> <span style="color: #339933;">+</span> port<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">1</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span>ajaxRunning<span style="color: #009900;">&#91;</span>port<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    ajaxRunning<span style="color: #009900;">&#91;</span>port<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
                    jQuery<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>ajax<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">dequeue</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;ajax&quot;</span> <span style="color: #339933;">+</span> port<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
&nbsp;
                <span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">&quot;sync&quot;</span><span style="color: #339933;">:</span>
                <span style="color: #003366; font-weight: bold;">var</span> pos <span style="color: #339933;">=</span> synced.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>
&nbsp;
                synced<span style="color: #009900;">&#91;</span>pos<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
                    error<span style="color: #339933;">:</span> settings.<span style="color: #660066;">error</span><span style="color: #339933;">,</span>
                    success<span style="color: #339933;">:</span> settings.<span style="color: #660066;">success</span><span style="color: #339933;">,</span>
                    complete<span style="color: #339933;">:</span> settings.<span style="color: #660066;">complete</span><span style="color: #339933;">,</span>
                    done<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span>
                <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
                syncedData<span style="color: #009900;">&#91;</span>pos<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
                    error<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
                    success<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
                    complete<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span>
                <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
                settings.<span style="color: #660066;">error</span> <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> syncedData<span style="color: #009900;">&#91;</span>pos<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">error</span> <span style="color: #339933;">=</span> arguments<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
                settings.<span style="color: #660066;">success</span> <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> syncedData<span style="color: #009900;">&#91;</span>pos<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">success</span> <span style="color: #339933;">=</span> arguments<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
                settings.<span style="color: #660066;">complete</span> <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>
                    syncedData<span style="color: #009900;">&#91;</span>pos<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">complete</span> <span style="color: #339933;">=</span> arguments<span style="color: #339933;">;</span>
                    synced<span style="color: #009900;">&#91;</span>pos<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">done</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
&nbsp;
                    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>pos <span style="color: #339933;">==</span> <span style="color: #CC0000;">0</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span>synced<span style="color: #009900;">&#91;</span>pos <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
                        <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> pos<span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> synced.<span style="color: #660066;">length</span> <span style="color: #339933;">&amp;&amp;</span> synced<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">done</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</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>synced<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">error</span><span style="color: #009900;">&#41;</span> synced<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">error</span>.<span style="color: #660066;">apply</span><span style="color: #009900;">&#40;</span>jQuery<span style="color: #339933;">,</span> syncedData<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">error</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>synced<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">success</span><span style="color: #009900;">&#41;</span> synced<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">success</span>.<span style="color: #660066;">apply</span><span style="color: #009900;">&#40;</span>jQuery<span style="color: #339933;">,</span> syncedData<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">success</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>synced<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">complete</span><span style="color: #009900;">&#41;</span> synced<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">complete</span>.<span style="color: #660066;">apply</span><span style="color: #009900;">&#40;</span>jQuery<span style="color: #339933;">,</span> syncedData<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">complete</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                        synced<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
                        syncedData<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
                    <span style="color: #009900;">&#125;</span>
                <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066; font-weight: bold;">return</span> ajax.<span style="color: #660066;">apply</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span> arguments<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: #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>



<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=AjaxQueue+and+jQuery+1.3+-+&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.onemoretake.com/2009/10/11/ajaxqueue-and-jquery-1-3/&amp;t=AjaxQueue+and+jQuery+1.3" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.onemoretake.com/2009/10/11/ajaxqueue-and-jquery-1-3/&amp;title=AjaxQueue+and+jQuery+1.3" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.onemoretake.com/2009/10/11/ajaxqueue-and-jquery-1-3/&amp;title=AjaxQueue+and+jQuery+1.3&amp;summary=%20The%20website%20that%20I%20work%20on%20for%20the%20majority%20of%20my%20time%20had%20been%20running%20on%20the%20rather%20out%20of%20date%20jQuery%201.2%20for%20quite%20some%20time.%20I%20recently%20found%20myself%20with%20a%20little%20bit%20of%20downtime%20and%20decided%20it%20was%20a%20good%20time%20to%20see%20if%20we%20could%20upgrade%20and%20take%20advantage%20of%20all%20the%20speed%20improvements%20that%20the&amp;source=onemoretake" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.onemoretake.com/2009/10/11/ajaxqueue-and-jquery-1-3/&amp;title=AjaxQueue+and+jQuery+1.3" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-blinklist">
			<a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http://www.onemoretake.com/2009/10/11/ajaxqueue-and-jquery-1-3/&amp;Title=AjaxQueue+and+jQuery+1.3" rel="nofollow" class="external" title="Share this on Blinklist">Share this on Blinklist</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.onemoretake.com/2009/10/11/ajaxqueue-and-jquery-1-3/&amp;title=AjaxQueue+and+jQuery+1.3" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-hackernews">
			<a href="http://news.ycombinator.com/submitlink?u=http://www.onemoretake.com/2009/10/11/ajaxqueue-and-jquery-1-3/&amp;t=AjaxQueue+and+jQuery+1.3" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.onemoretake.com/2009/10/11/ajaxqueue-and-jquery-1-3/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.onemoretake.com/2009/10/11/ajaxqueue-and-jquery-1-3/&amp;title=AjaxQueue+and+jQuery+1.3" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.onemoretake.com/2009/10/11/ajaxqueue-and-jquery-1-3/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22AjaxQueue%20and%20jQuery%201.3%22&amp;body=Link: http://www.onemoretake.com/2009/10/11/ajaxqueue-and-jquery-1-3/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A %20The%20website%20that%20I%20work%20on%20for%20the%20majority%20of%20my%20time%20had%20been%20running%20on%20the%20rather%20out%20of%20date%20jQuery%201.2%20for%20quite%20some%20time.%20I%20recently%20found%20myself%20with%20a%20little%20bit%20of%20downtime%20and%20decided%20it%20was%20a%20good%20time%20to%20see%20if%20we%20could%20upgrade%20and%20take%20advantage%20of%20all%20the%20speed%20improvements%20that%20the" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.onemoretake.com/2009/10/11/ajaxqueue-and-jquery-1-3/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Cuesheet Maker Bookmarklet for Discogs.com</title>
		<link>http://www.onemoretake.com/2009/09/18/cuesheet-maker-bookmarklet-for-discogs-com/</link>
		<comments>http://www.onemoretake.com/2009/09/18/cuesheet-maker-bookmarklet-for-discogs-com/#comments</comments>
		<pubDate>Sat, 19 Sep 2009 01:52:30 +0000</pubDate>
		<dc:creator>dan</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[bookmarklet]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.onemoretake.com/?p=268</guid>
		<description><![CDATA[Yesterday I discovered I had a few albums that had been ripped as a single track. I prefer having individual tracks and usually head on over to cuesheet heaven to look for the appropriate file that allows me to split them up with the awesome Medieval Cue Splitter. However I had a few tracks that [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I discovered I had a few albums that had been ripped as a single track. I prefer having individual tracks and usually head on over to <a href="http://www.regeert.nl/cuesheet/" target="_blank">cuesheet heaven</a> to look for the appropriate file that allows me to split them up with the awesome <a href="http://www.medieval.it/content/view/28/70/" target="_blank">Medieval Cue Splitter</a>. However I had a few tracks that had I could not find the appropriate cuesheet file for. I find myself in this situation fairly regularly and have also noticed that these albums usually have an entry at <a href="http://www.discogs.com/" target="_blank">discogs.com</a>, which has all the details including track lengths.</p>
<p>This got me thinking that it would be awesome to be able to create cue files from discogs.com. So I created the following – a bookmarklet to do just that.</p>
<p><strong>Disclaimer:</strong> it is pretty rough and I cannot guarantee that it will work with all discogs.com entries and there is hardly any error checking. I have only used this in Firefox so I cannot guarantee it will work in any other browser. It only pops up a dialogue with the cuesheet contents on it but that was adequate for me to copy and paste it into a text file and tweak it so that it was a valid cuesheet.</p>
<p>The important thing is that it gathers the track names and artists and works out the index times. It also attempts to cope with double cds and also single tracks that are two different records playing at once (common with DJ mixes). Here is the bookmarklet (drag it into your bookmarks tookbar), followed by the code itself:</p>
<p>Drag this to your bookmark toolbar: <a href="javascript:(function(){var a=document.createElement(%27SCRIPT%27);a.type=%27text/javascript%27;a.src=%27http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js%27;a.onload=function(){var h=jQuery.trim(jQuery(%27div.profile h1%27).text()),g=jQuery.trim(h.substring(0,h.indexOf(%27-%27))),d=h+%27.mp3%27,i=0,b=0,e=[],j=1;h=jQuery.trim(h.substring(h.indexOf(%27-%27)+1));tracks=[];jQuery(%27div.tracklist .section_content > table tr%27).each(function(n,p){var q=jQuery.trim(jQuery(%27td.track_pos%27,this).text());if(q&#038;&#038;q!=%27%27){var m={},l=[],o=false;q=q.split(%27-%27);if(q.length>1){if(jQuery.trim(q[0])!=j){k();j=q[0]}else{if(parseInt(q[1])==b){o=true}}}if(!o){b+=1;m.trackno=b;m.artist=jQuery.trim(jQuery(%27td.track_artists%27,this).text()).replace(/\s-$/g,%27%27).replace(/\n/g,%27%27).replace(/\s+/g,%27 %27);m.artist=jQuery.trim(m.artist);m.artist=(m.artist==%27%27)?g:m.artist;m.title=jQuery.trim(jQuery(%27td.track_title%27,this).text());l=jQuery.trim(jQuery(%27td.track_duration%27,this).text()).split(%27:%27);m.index=f(i);i+=(l[0]*60)+(l[1]*1);tracks[tracks.length]=m}}});k();var c=%27%27;jQuery.each(e,function(m,l){c+=l+%27\n\n\n%27});alert(c);function k(){var m=unescape(%27%22%27),l=%27TITLE %27+m+h+m+%27\n%27;l+=%27PERFORMER %27+m+g+m+%27\n%27;l+=%27FILE %27+m+d+m+%27 MP3\n%27;jQuery.each(tracks,function(o,n){l+=%27  TRACK %27+n.trackno+%27 AUDIO\n%27;l+=%27    TITLE %27+m+n.title+m+%27\n%27;l+=%27    PERFORMER %27+m+n.artist+m+%27\n%27;l+=%27    INDEX 01 %27+m+n.index+m+%27\n%27});e[e.length]=l;i=0;b=0;tracks=[]}function f(l){var m=Math.floor(l/60),n=(l-(m*60));if(m<10){m=%270%27+m.toString()}if(n<10){n=%270%27+n.toString()}return m.toString()+%27:%27+n.toString()+%27:00%27}};document.getElementsByTagName(%27head%27)[0].appendChild(a)})();">Create Cue</a>
<p>The code itself:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">javascript<span style="color: #339933;">:</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> s<span style="color: #339933;">=</span>document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'SCRIPT'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
s.<span style="color: #660066;">type</span><span style="color: #339933;">=</span><span style="color: #3366CC;">'text/javascript'</span><span style="color: #339933;">;</span>
s.<span style="color: #660066;">src</span><span style="color: #339933;">=</span><span style="color: #3366CC;">'http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js'</span><span style="color: #339933;">;</span>
s.<span style="color: #000066;">onload</span><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> title <span style="color: #339933;">=</span> jQuery.<span style="color: #660066;">trim</span><span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div.profile h1'</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: #009900;">&#41;</span><span style="color: #339933;">,</span>
		performer <span style="color: #339933;">=</span> jQuery.<span style="color: #660066;">trim</span><span style="color: #009900;">&#40;</span>title.<span style="color: #660066;">substring</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span>title.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'-'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
		file <span style="color: #339933;">=</span> title <span style="color: #339933;">+</span> <span style="color: #3366CC;">'.mp3'</span><span style="color: #339933;">,</span> secCount <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> trkCount <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> cues <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> cdNo <span style="color: #339933;">=</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
	title <span style="color: #339933;">=</span> jQuery.<span style="color: #660066;">trim</span><span style="color: #009900;">&#40;</span>title.<span style="color: #660066;">substring</span><span style="color: #009900;">&#40;</span>title.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'-'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	tracks <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div.tracklist .section_content &gt; table tr'</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>ix<span style="color: #339933;">,</span> el<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> trackCd <span style="color: #339933;">=</span> jQuery.<span style="color: #660066;">trim</span><span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'td.track_pos'</span><span style="color: #339933;">,</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: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>trackCd <span style="color: #339933;">&amp;&amp;</span> trackCd <span style="color: #339933;">!=</span> <span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #003366; font-weight: bold;">var</span> track <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> tracktime <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> isDouble <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
			trackCd <span style="color: #339933;">=</span> trackCd.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'-'</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>trackCd.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">1</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>jQuery.<span style="color: #660066;">trim</span><span style="color: #009900;">&#40;</span>trackCd<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> cdNo<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					createCue<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					cdNo <span style="color: #339933;">=</span> trackCd<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</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;">else</span> <span style="color: #009900;">&#123;</span>
					<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>parseInt<span style="color: #009900;">&#40;</span>trackCd<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> trkCount<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						isDouble <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</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: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>isDouble<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				trkCount<span style="color: #339933;">+=</span><span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
				track<span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'trackno'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> trkCount<span style="color: #339933;">;</span>
				track<span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'artist'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span> jQuery.<span style="color: #660066;">trim</span><span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'td.track_artists'</span><span style="color: #339933;">,</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: #009900;">&#41;</span>.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/\s-$/g</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/\n/g</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/\s+/g</span><span style="color: #339933;">,</span><span style="color: #3366CC;">' '</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				track<span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'artist'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> jQuery.<span style="color: #660066;">trim</span><span style="color: #009900;">&#40;</span>track<span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'artist'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				track<span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'artist'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>track<span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'artist'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> performer <span style="color: #339933;">:</span> track<span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'artist'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
				track<span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'title'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> jQuery.<span style="color: #660066;">trim</span><span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'td.track_title'</span><span style="color: #339933;">,</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: #009900;">&#41;</span><span style="color: #339933;">;</span> 
				tracktime <span style="color: #339933;">=</span>jQuery.<span style="color: #660066;">trim</span><span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'td.track_duration'</span><span style="color: #339933;">,</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: #009900;">&#41;</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">':'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
				track<span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'index'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> secondsToMinSec<span style="color: #009900;">&#40;</span>secCount<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				secCount <span style="color: #339933;">+=</span> <span style="color: #009900;">&#40;</span>tracktime<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">*</span> <span style="color: #CC0000;">60</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span>tracktime<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">*</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				tracks<span style="color: #009900;">&#91;</span>tracks.<span style="color: #660066;">length</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> track<span style="color: #339933;">;</span>	
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	createCue<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #006600; font-style: italic;">//print it out</span>
	<span style="color: #003366; font-weight: bold;">var</span> output <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span>
	jQuery.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span>cues<span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>ix<span style="color: #339933;">,</span> cue<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		output <span style="color: #339933;">+=</span> cue <span style="color: #339933;">+</span> <span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>'</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;">alert</span><span style="color: #009900;">&#40;</span>output<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #003366; font-weight: bold;">function</span> createCue<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> quo <span style="color: #339933;">=</span> unescape<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'%22'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
			cue <span style="color: #339933;">=</span> <span style="color: #3366CC;">'TITLE '</span><span style="color: #339933;">+</span>quo<span style="color: #339933;">+</span>title<span style="color: #339933;">+</span>quo<span style="color: #339933;">+</span><span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: #339933;">;</span>
		cue <span style="color: #339933;">+=</span> <span style="color: #3366CC;">'PERFORMER '</span><span style="color: #339933;">+</span>quo<span style="color: #339933;">+</span>performer<span style="color: #339933;">+</span>quo<span style="color: #339933;">+</span><span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: #339933;">;</span>
		cue <span style="color: #339933;">+=</span> <span style="color: #3366CC;">'FILE '</span><span style="color: #339933;">+</span>quo<span style="color: #339933;">+</span>file<span style="color: #339933;">+</span>quo<span style="color: #339933;">+</span><span style="color: #3366CC;">' MP3<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: #339933;">;</span>
		jQuery.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span>tracks<span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>ix<span style="color: #339933;">,</span> track<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			cue <span style="color: #339933;">+=</span> <span style="color: #3366CC;">'  TRACK '</span><span style="color: #339933;">+</span>track.<span style="color: #660066;">trackno</span><span style="color: #339933;">+</span><span style="color: #3366CC;">' AUDIO<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: #339933;">;</span>
			cue <span style="color: #339933;">+=</span> <span style="color: #3366CC;">'    TITLE '</span><span style="color: #339933;">+</span>quo<span style="color: #339933;">+</span>track.<span style="color: #660066;">title</span><span style="color: #339933;">+</span>quo<span style="color: #339933;">+</span><span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: #339933;">;</span>
			cue <span style="color: #339933;">+=</span> <span style="color: #3366CC;">'    PERFORMER '</span><span style="color: #339933;">+</span>quo<span style="color: #339933;">+</span>track.<span style="color: #660066;">artist</span><span style="color: #339933;">+</span>quo<span style="color: #339933;">+</span><span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: #339933;">;</span>
			cue <span style="color: #339933;">+=</span> <span style="color: #3366CC;">'    INDEX 01 '</span><span style="color: #339933;">+</span>quo<span style="color: #339933;">+</span>track.<span style="color: #660066;">index</span><span style="color: #339933;">+</span>quo<span style="color: #339933;">+</span><span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		cues<span style="color: #009900;">&#91;</span>cues.<span style="color: #660066;">length</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> cue<span style="color: #339933;">;</span>
		<span style="color: #006600; font-style: italic;">//reset</span>
		secCount <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> trkCount <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> tracks <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #003366; font-weight: bold;">function</span> secondsToMinSec<span style="color: #009900;">&#40;</span>totsec<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> min <span style="color: #339933;">=</span> Math.<span style="color: #660066;">floor</span><span style="color: #009900;">&#40;</span>totsec <span style="color: #339933;">/</span> <span style="color: #CC0000;">60</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> 
			sec <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>totsec <span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span>min <span style="color: #339933;">*</span> <span style="color: #CC0000;">60</span><span style="color: #009900;">&#41;</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>min <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">10</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			min <span style="color: #339933;">=</span> <span style="color: #3366CC;">'0'</span> <span style="color: #339933;">+</span> min.<span style="color: #660066;">toString</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: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>sec <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">10</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			sec <span style="color: #339933;">=</span> <span style="color: #3366CC;">'0'</span> <span style="color: #339933;">+</span> sec.<span style="color: #660066;">toString</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: #000066; font-weight: bold;">return</span> min.<span style="color: #660066;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">':'</span> <span style="color: #339933;">+</span> sec.<span style="color: #660066;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">':00'</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'head'</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: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>s<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><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>I hope this helps some people, as it has me. Feel free to improve on it but if you make any changes, please let me know so that I can improve my version too.</p>
<p>Enjoy</p>
<p><strong>Edit:</strong> Well it was not long until discogs changed their layout. I have update the code to reflect this. All should be well again.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Cuesheet+Maker+Bookmarklet+for+Discogs.com+-+&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.onemoretake.com/2009/09/18/cuesheet-maker-bookmarklet-for-discogs-com/&amp;t=Cuesheet+Maker+Bookmarklet+for+Discogs.com" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.onemoretake.com/2009/09/18/cuesheet-maker-bookmarklet-for-discogs-com/&amp;title=Cuesheet+Maker+Bookmarklet+for+Discogs.com" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.onemoretake.com/2009/09/18/cuesheet-maker-bookmarklet-for-discogs-com/&amp;title=Cuesheet+Maker+Bookmarklet+for+Discogs.com&amp;summary=Yesterday%20I%20discovered%20I%20had%20a%20few%20albums%20that%20had%20been%20ripped%20as%20a%20single%20track.%20I%20prefer%20having%20individual%20tracks%20and%20usually%20head%20on%20over%20to%20cuesheet%20heaven%20to%20look%20for%20the%20appropriate%20file%20that%20allows%20me%20to%20split%20them%20up%20with%20the%20awesome%20Medieval%20Cue%20Splitter.%20However%20I%20had%20a%20few%20tracks%20that%20had&amp;source=onemoretake" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.onemoretake.com/2009/09/18/cuesheet-maker-bookmarklet-for-discogs-com/&amp;title=Cuesheet+Maker+Bookmarklet+for+Discogs.com" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-blinklist">
			<a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http://www.onemoretake.com/2009/09/18/cuesheet-maker-bookmarklet-for-discogs-com/&amp;Title=Cuesheet+Maker+Bookmarklet+for+Discogs.com" rel="nofollow" class="external" title="Share this on Blinklist">Share this on Blinklist</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.onemoretake.com/2009/09/18/cuesheet-maker-bookmarklet-for-discogs-com/&amp;title=Cuesheet+Maker+Bookmarklet+for+Discogs.com" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-hackernews">
			<a href="http://news.ycombinator.com/submitlink?u=http://www.onemoretake.com/2009/09/18/cuesheet-maker-bookmarklet-for-discogs-com/&amp;t=Cuesheet+Maker+Bookmarklet+for+Discogs.com" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.onemoretake.com/2009/09/18/cuesheet-maker-bookmarklet-for-discogs-com/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.onemoretake.com/2009/09/18/cuesheet-maker-bookmarklet-for-discogs-com/&amp;title=Cuesheet+Maker+Bookmarklet+for+Discogs.com" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.onemoretake.com/2009/09/18/cuesheet-maker-bookmarklet-for-discogs-com/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22Cuesheet%20Maker%20Bookmarklet%20for%20Discogs.com%22&amp;body=Link: http://www.onemoretake.com/2009/09/18/cuesheet-maker-bookmarklet-for-discogs-com/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A Yesterday%20I%20discovered%20I%20had%20a%20few%20albums%20that%20had%20been%20ripped%20as%20a%20single%20track.%20I%20prefer%20having%20individual%20tracks%20and%20usually%20head%20on%20over%20to%20cuesheet%20heaven%20to%20look%20for%20the%20appropriate%20file%20that%20allows%20me%20to%20split%20them%20up%20with%20the%20awesome%20Medieval%20Cue%20Splitter.%20However%20I%20had%20a%20few%20tracks%20that%20had" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.onemoretake.com/2009/09/18/cuesheet-maker-bookmarklet-for-discogs-com/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>IIS7 WordPress and Friendly URLs</title>
		<link>http://www.onemoretake.com/2009/08/31/iis7-wordpress-and-friendly-urls/</link>
		<comments>http://www.onemoretake.com/2009/08/31/iis7-wordpress-and-friendly-urls/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 06:54:54 +0000</pubDate>
		<dc:creator>dan</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[iis7]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://www.onemoretake.com/2009/08/31/iis7-wordpress-and-friendly-urls/</guid>
		<description><![CDATA[As a developer who uses Vista as their main OS, I have always found developing php sites a little bit awkward. Php never liked to play nicely with IIS and unless you installed and used Apache, friendly URLs were even more difficult to get working. I use IIS extensively for ASP.NET development and I never [...]]]></description>
			<content:encoded><![CDATA[<p>As a developer who uses Vista as their main OS, I have always found developing php sites a little bit awkward. Php never liked to play nicely with IIS and unless you installed and used Apache, friendly URLs were even more difficult to get working. I use IIS extensively for ASP.NET development and I never liked having both Apache and IIS installed together as they seemed to lock horns at every opportunity. My answer until now was to use <a href="http://www.jcxsoftware.com/vs.php" target="_blank">VS.php</a>, which runs an instance of Apache on demand, so I only have to use Apache when I need to. This was great for the most part but last week I had the situation where I was trying to work on both an ASP.NET project and a WordPress project at the same time. Stopping and starting web servers every few minutes was getting a little dull.</p>
<p><a href="http://www.onemoretake.com/wp-content/uploads/2009/08/rewrite.png"><img title="rewrite" style="border-right: 0px; border-top: 0px; display: inline; margin: 10px 25px 0px 0px; border-left: 0px; border-bottom: 0px" height="198" alt="rewrite" src="http://www.onemoretake.com/wp-content/uploads/2009/08/rewrite_thumb.png" width="314" align="left" border="0" /></a>This spurred me on to take some time to see what all <a href="http://www.itworld.com/development/73001/how-microsoft-made-php-suck-less-windows" target="_blank">the fuss about IIS7 and php was really about</a>. I was pleasantly surprised. Since Vista SP1, it is possible to configure IIS to run php using FastCGI. I won’t go into the detail here, <a href="http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis-70/" target="_blank">there are plenty of examples on how to configure php</a> in this way. Needless to say, it was not too difficult and I had a test phpinfo(); page displaying in no time. What’s particularly great is that Microsoft has been doing some great work getting php to run as quickly and efficiently as it can on IIS. If you are happy running php version 5.3, over at <a href="http://windows.php.net/" target="_blank">Php for Windows</a>, you can pick up a version that has been compiled in Visual Studio 2008 which means faster and more stable than before.</p>
<p>The next step in my investigation was to see what could be done with the new <a href="http://www.iis.net/extensions/URLRewrite" target="_blank">url rewrite module for IIS</a>. Another easy thing to install. What’s more, it has the ability to import .htaccess files. I use these extensively when using Apache and I already had one for the WordPress site I was working on. Importing rules is a pleasure because of the neat interface that shows you which rules it can convert and which it cannot. Editing the original .htaccess directives on-screen allows you to fix those rules it is having trouble with. In my case it was just the RewriteBase, which I could happily remove without worrying about it.</p>
<p>One click of the ‘apply’ button and I was up add running. The site was responsive and low and behold, no issues with the friendly urls. Too easy!</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=IIS7+Wordpress+and+Friendly+URLs+-+&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.onemoretake.com/2009/08/31/iis7-wordpress-and-friendly-urls/&amp;t=IIS7+Wordpress+and+Friendly+URLs" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.onemoretake.com/2009/08/31/iis7-wordpress-and-friendly-urls/&amp;title=IIS7+Wordpress+and+Friendly+URLs" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.onemoretake.com/2009/08/31/iis7-wordpress-and-friendly-urls/&amp;title=IIS7+Wordpress+and+Friendly+URLs&amp;summary=As%20a%20developer%20who%20uses%20Vista%20as%20their%20main%20OS%2C%20I%20have%20always%20found%20developing%20php%20sites%20a%20little%20bit%20awkward.%20Php%20never%20liked%20to%20play%20nicely%20with%20IIS%20and%20unless%20you%20installed%20and%20used%20Apache%2C%20friendly%20URLs%20were%20even%20more%20difficult%20to%20get%20working.%20I%20use%20IIS%20extensively%20for%20ASP.NET%20development%20and%20I%20&amp;source=onemoretake" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.onemoretake.com/2009/08/31/iis7-wordpress-and-friendly-urls/&amp;title=IIS7+Wordpress+and+Friendly+URLs" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-blinklist">
			<a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http://www.onemoretake.com/2009/08/31/iis7-wordpress-and-friendly-urls/&amp;Title=IIS7+Wordpress+and+Friendly+URLs" rel="nofollow" class="external" title="Share this on Blinklist">Share this on Blinklist</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.onemoretake.com/2009/08/31/iis7-wordpress-and-friendly-urls/&amp;title=IIS7+Wordpress+and+Friendly+URLs" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-hackernews">
			<a href="http://news.ycombinator.com/submitlink?u=http://www.onemoretake.com/2009/08/31/iis7-wordpress-and-friendly-urls/&amp;t=IIS7+Wordpress+and+Friendly+URLs" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.onemoretake.com/2009/08/31/iis7-wordpress-and-friendly-urls/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.onemoretake.com/2009/08/31/iis7-wordpress-and-friendly-urls/&amp;title=IIS7+Wordpress+and+Friendly+URLs" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.onemoretake.com/2009/08/31/iis7-wordpress-and-friendly-urls/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22IIS7%20Wordpress%20and%20Friendly%20URLs%22&amp;body=Link: http://www.onemoretake.com/2009/08/31/iis7-wordpress-and-friendly-urls/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A As%20a%20developer%20who%20uses%20Vista%20as%20their%20main%20OS%2C%20I%20have%20always%20found%20developing%20php%20sites%20a%20little%20bit%20awkward.%20Php%20never%20liked%20to%20play%20nicely%20with%20IIS%20and%20unless%20you%20installed%20and%20used%20Apache%2C%20friendly%20URLs%20were%20even%20more%20difficult%20to%20get%20working.%20I%20use%20IIS%20extensively%20for%20ASP.NET%20development%20and%20I%20" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.onemoretake.com/2009/08/31/iis7-wordpress-and-friendly-urls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Server 2008, ASP.NET, Pre-compiling and Virtual Directories</title>
		<link>http://www.onemoretake.com/2009/06/05/windows-server-2008-aspnet-pre-compiling-and-virtual-directories/</link>
		<comments>http://www.onemoretake.com/2009/06/05/windows-server-2008-aspnet-pre-compiling-and-virtual-directories/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 23:28:47 +0000</pubDate>
		<dc:creator>dan</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Virtual Directory]]></category>
		<category><![CDATA[Windows Server 2008]]></category>

		<guid isPermaLink="false">http://www.onemoretake.com/2009/06/05/windows-server-2008-aspnet-pre-compiling-and-virtual-directories/</guid>
		<description><![CDATA[There has been an interesting problem at work over the last couple of weeks. We are in the process of preparing to move service providers and at the same time upgrading all our servers to run Windows Server 2008 and SQL Server 2008. In preparation for this move, we have been upgrading our staging and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.onemoretake.com/wp-content/uploads/2009/06/windowsserver2008.png"><img title="windowsserver2008" style="border-right: 0px; border-top: 0px; display: inline; margin: 0px 20px 0px 0px; border-left: 0px; border-bottom: 0px" height="104" alt="windowsserver2008" src="http://www.onemoretake.com/wp-content/uploads/2009/06/windowsserver2008-thumb.png" width="222" align="left" border="0" /></a> There has been an interesting problem at work over the last couple of weeks. We are in the process of preparing to move service providers and at the same time upgrading all our servers to run Windows Server 2008 and SQL Server 2008. In preparation for this move, we have been upgrading our staging and test servers so we can be sure that everything will work as expected and to iron out the processes, so the move goes as smoothly as possible.</p>
<p>It took about ten minutes before we hit the strangest of problems. It was focused around the way we use a virtual directory to share common code and controls across different websites. The premise is that you create a project to hold your common javascript/images/ascx controls/web services and so on. You then use a virtual directory inside each of your websites that points to the common project. With only <a href="http://webproject.scottgu.com/CSharp/UserControls/UserControls.aspx" target="_blank">a small amount of tweaking for the common ascx controls</a> everything seems to work without too much trouble. That is, until you try to do this on Windows Server 2008.</p>
<p>When we started up our web application on our new environment, we noticed almost immediately that the AJAX calls that used the common web service were failing. The error message was suggesting that the project that contained the common web service has not been compiled correctly. By copying the website across to a Windows 2003 server, we deduced that the problem was specific to 2008 as it worked perfectly on 2003. Having exhausted all the developers ideas on why this would be, we called Microsoft and got them involved in troubleshooting the issue.</p>
<p>A few days later an answer came: <em>do not pre-compile your website</em>. Sure enough, build the website without pre-compilation and it worked perfectly. Microsoft’s explanation was that it was due to a change in the way that Windows Server 2008/IIS7 worked. Fairly cryptic I must say and certainly does not leave me satisfied as to why it would not work and what have they done to stop it working. For us, using Windows Server 2008 and IIS7 is more important than the slight performance hit you get when deploying without pre-compilation. For others it may not be such a desirable solution.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Windows+Server+2008%2C+ASP.NET%2C+Pre-compiling+and+Virtual+Directories+-+&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.onemoretake.com/2009/06/05/windows-server-2008-aspnet-pre-compiling-and-virtual-directories/&amp;t=Windows+Server+2008%2C+ASP.NET%2C+Pre-compiling+and+Virtual+Directories" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.onemoretake.com/2009/06/05/windows-server-2008-aspnet-pre-compiling-and-virtual-directories/&amp;title=Windows+Server+2008%2C+ASP.NET%2C+Pre-compiling+and+Virtual+Directories" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.onemoretake.com/2009/06/05/windows-server-2008-aspnet-pre-compiling-and-virtual-directories/&amp;title=Windows+Server+2008%2C+ASP.NET%2C+Pre-compiling+and+Virtual+Directories&amp;summary=%20There%20has%20been%20an%20interesting%20problem%20at%20work%20over%20the%20last%20couple%20of%20weeks.%20We%20are%20in%20the%20process%20of%20preparing%20to%20move%20service%20providers%20and%20at%20the%20same%20time%20upgrading%20all%20our%20servers%20to%20run%20Windows%20Server%202008%20and%20SQL%20Server%202008.%20In%20preparation%20for%20this%20move%2C%20we%20have%20been%20upgrading%20our%20staging%20a&amp;source=onemoretake" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.onemoretake.com/2009/06/05/windows-server-2008-aspnet-pre-compiling-and-virtual-directories/&amp;title=Windows+Server+2008%2C+ASP.NET%2C+Pre-compiling+and+Virtual+Directories" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-blinklist">
			<a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http://www.onemoretake.com/2009/06/05/windows-server-2008-aspnet-pre-compiling-and-virtual-directories/&amp;Title=Windows+Server+2008%2C+ASP.NET%2C+Pre-compiling+and+Virtual+Directories" rel="nofollow" class="external" title="Share this on Blinklist">Share this on Blinklist</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.onemoretake.com/2009/06/05/windows-server-2008-aspnet-pre-compiling-and-virtual-directories/&amp;title=Windows+Server+2008%2C+ASP.NET%2C+Pre-compiling+and+Virtual+Directories" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-hackernews">
			<a href="http://news.ycombinator.com/submitlink?u=http://www.onemoretake.com/2009/06/05/windows-server-2008-aspnet-pre-compiling-and-virtual-directories/&amp;t=Windows+Server+2008%2C+ASP.NET%2C+Pre-compiling+and+Virtual+Directories" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.onemoretake.com/2009/06/05/windows-server-2008-aspnet-pre-compiling-and-virtual-directories/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.onemoretake.com/2009/06/05/windows-server-2008-aspnet-pre-compiling-and-virtual-directories/&amp;title=Windows+Server+2008%2C+ASP.NET%2C+Pre-compiling+and+Virtual+Directories" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.onemoretake.com/2009/06/05/windows-server-2008-aspnet-pre-compiling-and-virtual-directories/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22Windows%20Server%202008%2C%20ASP.NET%2C%20Pre-compiling%20and%20Virtual%20Directories%22&amp;body=Link: http://www.onemoretake.com/2009/06/05/windows-server-2008-aspnet-pre-compiling-and-virtual-directories/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A %20There%20has%20been%20an%20interesting%20problem%20at%20work%20over%20the%20last%20couple%20of%20weeks.%20We%20are%20in%20the%20process%20of%20preparing%20to%20move%20service%20providers%20and%20at%20the%20same%20time%20upgrading%20all%20our%20servers%20to%20run%20Windows%20Server%202008%20and%20SQL%20Server%202008.%20In%20preparation%20for%20this%20move%2C%20we%20have%20been%20upgrading%20our%20staging%20a" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.onemoretake.com/2009/06/05/windows-server-2008-aspnet-pre-compiling-and-virtual-directories/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss><!-- Dynamic page generated in 6.560 seconds. --><!-- Cached page generated by WP-Super-Cache on 2010-09-08 08:25:12 -->
