<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments for NelsonWells.net</title>
	<atom:link href="http://nelsonwells.net/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://nelsonwells.net</link>
	<description>Programming and other distractions</description>
	<lastBuildDate>Thu, 09 Feb 2012 13:48:56 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>Comment on JSON.stringify with mapped variables by Carlos Roque</title>
		<link>http://nelsonwells.net/2012/02/json-stringify-with-mapped-variables/#comment-2071</link>
		<dc:creator>Carlos Roque</dc:creator>
		<pubDate>Thu, 09 Feb 2012 13:48:56 +0000</pubDate>
		<guid isPermaLink="false">http://nelsonwells.net/?p=153#comment-2071</guid>
		<description>cudos this is actually interesting. did you ever find out why this works?</description>
		<content:encoded><![CDATA[<p>cudos this is actually interesting. did you ever find out why this works?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Update any index in CodeIgniter Cart class by Otuoma Sanya</title>
		<link>http://nelsonwells.net/2010/04/update-any-index-in-codeigniter-cart-class/#comment-1825</link>
		<dc:creator>Otuoma Sanya</dc:creator>
		<pubDate>Tue, 17 Jan 2012 15:03:51 +0000</pubDate>
		<guid isPermaLink="false">http://nelsonwells.net/?p=43#comment-1825</guid>
		<description>Sorry for the bother but the script works fine, I had included an array value and that is why I was having the trouble. Again, thank you!</description>
		<content:encoded><![CDATA[<p>Sorry for the bother but the script works fine, I had included an array value and that is why I was having the trouble. Again, thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Update any index in CodeIgniter Cart class by Nelson</title>
		<link>http://nelsonwells.net/2010/04/update-any-index-in-codeigniter-cart-class/#comment-1807</link>
		<dc:creator>Nelson</dc:creator>
		<pubDate>Sun, 15 Jan 2012 02:06:58 +0000</pubDate>
		<guid isPermaLink="false">http://nelsonwells.net/?p=43#comment-1807</guid>
		<description>Otuoma, as you&#039;ve found, the reason for the undefined function CI_Cart is that CodeIgniter 2+ is built for PHP5 and has removed older PHP4 functionality.  You did the correct thing by changing parent::CI_Cart(); to parent::__construct();

With that said, I do not know why the cart is not updating as expected.  I have just updated the extended cart class to CI 2.1.0 and had no problems getting the sample application to work.  During the upgrade, the only things I changed were the parent call in the controller and the class itself.  Maybe you could review my use of the class in the updated sample application and identify what you are doing differently?</description>
		<content:encoded><![CDATA[<p>Otuoma, as you&#8217;ve found, the reason for the undefined function CI_Cart is that CodeIgniter 2+ is built for PHP5 and has removed older PHP4 functionality.  You did the correct thing by changing parent::CI_Cart(); to parent::__construct();</p>
<p>With that said, I do not know why the cart is not updating as expected.  I have just updated the extended cart class to CI 2.1.0 and had no problems getting the sample application to work.  During the upgrade, the only things I changed were the parent call in the controller and the class itself.  Maybe you could review my use of the class in the updated sample application and identify what you are doing differently?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Update any index in CodeIgniter Cart class by Otuoma Sanya</title>
		<link>http://nelsonwells.net/2010/04/update-any-index-in-codeigniter-cart-class/#comment-1799</link>
		<dc:creator>Otuoma Sanya</dc:creator>
		<pubDate>Sat, 14 Jan 2012 12:23:40 +0000</pubDate>
		<guid isPermaLink="false">http://nelsonwells.net/?p=43#comment-1799</guid>
		<description>I am trying to use this method on a project. However, when I use it as per your instructions, I get the error : Fatal error: Call to undefined method CI_Cart::CI_Cart() in C:\xampp\htdocs\benta-pos\application\libraries\MY_Cart.php on line 9. 

When I change the constructor to:
&lt;code&gt;
function __construct()
    {
        parent::__construct();
    }
&lt;/code&gt;
Then the cart does not update and I get the same cart contents.

I am using CI 2.0.3
Do you have any solution for this?</description>
		<content:encoded><![CDATA[<p>I am trying to use this method on a project. However, when I use it as per your instructions, I get the error : Fatal error: Call to undefined method CI_Cart::CI_Cart() in C:\xampp\htdocs\benta-pos\application\libraries\MY_Cart.php on line 9. </p>
<p>When I change the constructor to:<br />
<code><br />
function __construct()<br />
    {<br />
        parent::__construct();<br />
    }<br />
</code><br />
Then the cart does not update and I get the same cart contents.</p>
<p>I am using CI 2.0.3<br />
Do you have any solution for this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Zip code library in CodeIgniter by Nelson</title>
		<link>http://nelsonwells.net/2010/07/zip-code-library-in-codeigniter/#comment-1745</link>
		<dc:creator>Nelson</dc:creator>
		<pubDate>Tue, 10 Jan 2012 06:04:12 +0000</pubDate>
		<guid isPermaLink="false">http://nelsonwells.net/?p=47#comment-1745</guid>
		<description>Jason, the latest version in my BitBucket account will work with CI 2.0, but I do not know if it will work without modification to 2.1.0.  If it doesn&#039;t, it will probably not be too difficult to fix.

The data in the included dump is not up to date.  It has most of the geographic data, but I believe there have been some zips added since the data was collected.</description>
		<content:encoded><![CDATA[<p>Jason, the latest version in my BitBucket account will work with CI 2.0, but I do not know if it will work without modification to 2.1.0.  If it doesn&#8217;t, it will probably not be too difficult to fix.</p>
<p>The data in the included dump is not up to date.  It has most of the geographic data, but I believe there have been some zips added since the data was collected.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Zip code library in CodeIgniter by Jason Shultz</title>
		<link>http://nelsonwells.net/2010/07/zip-code-library-in-codeigniter/#comment-1743</link>
		<dc:creator>Jason Shultz</dc:creator>
		<pubDate>Tue, 10 Jan 2012 05:29:02 +0000</pubDate>
		<guid isPermaLink="false">http://nelsonwells.net/?p=47#comment-1743</guid>
		<description>Thank you for this! Would you still consider this up to date?</description>
		<content:encoded><![CDATA[<p>Thank you for this! Would you still consider this up to date?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Introduction to memoization with Javascript by Nelson</title>
		<link>http://nelsonwells.net/2011/09/introduction-to-memoization-with-javascript/#comment-1334</link>
		<dc:creator>Nelson</dc:creator>
		<pubDate>Thu, 15 Dec 2011 04:58:25 +0000</pubDate>
		<guid isPermaLink="false">http://nelsonwells.net/?p=112#comment-1334</guid>
		<description>In the example I gave, yes, the function has amortized speed increases; there are no useful keys in the look-up table until the function has been fully executed at least once.  However, this has to do with the linearity of the factorial function (5! * 4! * 3!...).  

Consider the Fibonacci sequence where f(n) = f(n - 1) + f(n - 2).  Given n = 6 on the first call to the function, fib(5) and fib(4) will be calculated.  However, fib(5) will &lt;em&gt;also&lt;/em&gt; calculate fib(5-1), which has &lt;em&gt;already&lt;/em&gt; been calculated by fib(6).  That is wasted effort.  If you run this script in Firebug, it will take a long time to complete or freeze/crash.  

&lt;pre style=&quot;margin-left:55px; margin-top:15px; margin-bottom:15px&quot;&gt;
var fib = function(n) {
  if(n == 0 &#124;&#124; n == 1) {
    return n;
  }

  return fib(n - 1) + fib(n - 2);
}

fib(100);
&lt;/pre&gt; 


&lt;strong&gt;However&lt;/strong&gt;, this snippet of code will run very quickly.  The function is &lt;em&gt;not&lt;/em&gt; amortized; it will run quickly on the first execution.


&lt;pre style=&quot;margin-left:55px; margin-top:10px; margin-bottom:15px&quot;&gt;
var computed = {};

var fib = function(n) {
  if(n == 0 &#124;&#124; n == 1) {
    return n;
  }

  if(computed[n]) {
    return computed[n];
  }

  var val = fib(n - 1) + fib(n - 2);
  computed[n] = val;
  return val;
}

fib(100);
&lt;/pre&gt;


As for storing the look-up table in a more persistent location... that is definitely a possibility and a good idea depending on the context.  I believe there is another term for this other than memoization, but I can&#039;t think of it right now :razz:</description>
		<content:encoded><![CDATA[<p>In the example I gave, yes, the function has amortized speed increases; there are no useful keys in the look-up table until the function has been fully executed at least once.  However, this has to do with the linearity of the factorial function (5! * 4! * 3!&#8230;).  </p>
<p>Consider the Fibonacci sequence where f(n) = f(n &#8211; 1) + f(n &#8211; 2).  Given n = 6 on the first call to the function, fib(5) and fib(4) will be calculated.  However, fib(5) will <em>also</em> calculate fib(5-1), which has <em>already</em> been calculated by fib(6).  That is wasted effort.  If you run this script in Firebug, it will take a long time to complete or freeze/crash.  </p>
<pre style="margin-left:55px; margin-top:15px; margin-bottom:15px">
var fib = function(n) {
  if(n == 0 || n == 1) {
    return n;
  }

  return fib(n - 1) + fib(n - 2);
}

fib(100);
</pre>
<p><strong>However</strong>, this snippet of code will run very quickly.  The function is <em>not</em> amortized; it will run quickly on the first execution.</p>
<pre style="margin-left:55px; margin-top:10px; margin-bottom:15px">
var computed = {};

var fib = function(n) {
  if(n == 0 || n == 1) {
    return n;
  }

  if(computed[n]) {
    return computed[n];
  }

  var val = fib(n - 1) + fib(n - 2);
  computed[n] = val;
  return val;
}

fib(100);
</pre>
<p>As for storing the look-up table in a more persistent location&#8230; that is definitely a possibility and a good idea depending on the context.  I believe there is another term for this other than memoization, but I can&#8217;t think of it right now <img src='http://nelsonwells.net/wp-includes/images/smilies/icon_razz.gif' alt=':razz:' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Update any index in CodeIgniter Cart class by Nate</title>
		<link>http://nelsonwells.net/2010/04/update-any-index-in-codeigniter-cart-class/#comment-1304</link>
		<dc:creator>Nate</dc:creator>
		<pubDate>Tue, 13 Dec 2011 14:49:40 +0000</pubDate>
		<guid isPermaLink="false">http://nelsonwells.net/?p=43#comment-1304</guid>
		<description>Nice... This helped a lot.

It&#039;s worth noting that the MY in MY_Cart must be uppercase. I spent a little time trying to figure out how codeigniter knows to load my custom library. Turns out it just magically knows as long as you get the name of the file and class correct.</description>
		<content:encoded><![CDATA[<p>Nice&#8230; This helped a lot.</p>
<p>It&#8217;s worth noting that the MY in MY_Cart must be uppercase. I spent a little time trying to figure out how codeigniter knows to load my custom library. Turns out it just magically knows as long as you get the name of the file and class correct.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Introduction to memoization with Javascript by Carlos Roque</title>
		<link>http://nelsonwells.net/2011/09/introduction-to-memoization-with-javascript/#comment-1209</link>
		<dc:creator>Carlos Roque</dc:creator>
		<pubDate>Tue, 06 Dec 2011 15:43:44 +0000</pubDate>
		<guid isPermaLink="false">http://nelsonwells.net/?p=112#comment-1209</guid>
		<description>So in a real world escenarion, the script would need to be running for a long period and at the same time be used multiple times to collect data. otherwise if the look up table has to be populated over and over again, are you really seeing any performance inprovements? would you consider storing the lookup table as a way to improve on your script?</description>
		<content:encoded><![CDATA[<p>So in a real world escenarion, the script would need to be running for a long period and at the same time be used multiple times to collect data. otherwise if the look up table has to be populated over and over again, are you really seeing any performance inprovements? would you consider storing the lookup table as a way to improve on your script?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Introduction to web scraping with Node.js by Nelson</title>
		<link>http://nelsonwells.net/2011/11/introduction-to-web-scraping-with-node-js/#comment-1009</link>
		<dc:creator>Nelson</dc:creator>
		<pubDate>Fri, 11 Nov 2011 00:48:59 +0000</pubDate>
		<guid isPermaLink="false">http://nelsonwells.net/?p=129#comment-1009</guid>
		<description>Definitely, Daniel.  If there&#039;s no reason to scrape a site we won&#039;t do it :)</description>
		<content:encoded><![CDATA[<p>Definitely, Daniel.  If there&#8217;s no reason to scrape a site we won&#8217;t do it <img src='http://nelsonwells.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

