<?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 Ian Oxley</title>
	<atom:link href="http://ianoxley.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://ianoxley.com</link>
	<description>Web Developer</description>
	<lastBuildDate>Wed, 26 Oct 2011 22:09:31 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>Comment on encdec &#8211; BaseXX Encoding and Decoding in JavaScript by Ian</title>
		<link>http://ianoxley.com/2011/06/03/encdec-basexx-encoding-and-decoding-in-javascript/comment-page-1/#comment-11504</link>
		<dc:creator>Ian</dc:creator>
		<pubDate>Wed, 26 Oct 2011 22:09:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.strongasanox.co.uk/2011/06/03/encdec-javascript-library-for-base-encoding-and-decoding/#comment-11504</guid>
		<description>Thanks for the heads up - fixed the decoding issue :)</description>
		<content:encoded><![CDATA[<p>Thanks for the heads up &#8211; fixed the decoding issue <img src='http://ianoxley.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on encdec &#8211; BaseXX Encoding and Decoding in JavaScript by Rob</title>
		<link>http://ianoxley.com/2011/06/03/encdec-basexx-encoding-and-decoding-in-javascript/comment-page-1/#comment-10305</link>
		<dc:creator>Rob</dc:creator>
		<pubDate>Wed, 17 Aug 2011 01:10:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.strongasanox.co.uk/2011/06/03/encdec-javascript-library-for-base-encoding-and-decoding/#comment-10305</guid>
		<description>Hi

Thanks for you efforts. I&#039;ve think there are a couple of bugs in the javascript.

Firstly -
&quot;if (num) {encode = alphabet[num] + encode;}&quot; in &quot;encode&quot; and
&quot;decoded += multi * alphabet.indexOf(s[i]);&quot; in &quot;decode&quot;

This way of handling a string index works in Chrome/Firefox/Safari, but not in MSIE (even v9) as far as I can tell.

A more universal alternative is probably:
&quot;if (num) {encode = alphabet.charAt(num) + encode;}&quot; in &quot;encode&quot; and 
&quot;decoded += multi * alphabet.indexOf(s.charAt(i));&quot; in &quot;decode&quot;

The second bug is in the cache mechanism. For example:

var base58 = encdec(); // defaults to base58
console.log(base58.encode(255)); /* output = 5p  */
console.log(base58.decode(&#039;5p&#039;)); /* output = 255 */
console.log(base58.decode(&#039;p5&#039;)); /* output = 255 - should be 1338! */

This is because in &quot;decode&quot; the line that caches the current decoded variable
&quot;cache[s] = decoded;&quot; is working with a reversed version of the &quot;s&quot; parameter.

This can be corrected by having another variable which saves a copy of &quot;s&quot; before it&#039;s reversed eg &quot;t = s;&quot;, then using &quot;cache[t] = decoded;&quot;
 
Cheers.</description>
		<content:encoded><![CDATA[<p>Hi</p>
<p>Thanks for you efforts. I&#8217;ve think there are a couple of bugs in the javascript.</p>
<p>Firstly -<br />
&#8220;if (num) {encode = alphabet[num] + encode;}&#8221; in &#8220;encode&#8221; and<br />
&#8220;decoded += multi * alphabet.indexOf(s[i]);&#8221; in &#8220;decode&#8221;</p>
<p>This way of handling a string index works in Chrome/Firefox/Safari, but not in MSIE (even v9) as far as I can tell.</p>
<p>A more universal alternative is probably:<br />
&#8220;if (num) {encode = alphabet.charAt(num) + encode;}&#8221; in &#8220;encode&#8221; and<br />
&#8220;decoded += multi * alphabet.indexOf(s.charAt(i));&#8221; in &#8220;decode&#8221;</p>
<p>The second bug is in the cache mechanism. For example:</p>
<p>var base58 = encdec(); // defaults to base58<br />
console.log(base58.encode(255)); /* output = 5p  */<br />
console.log(base58.decode(&#8217;5p&#8217;)); /* output = 255 */<br />
console.log(base58.decode(&#8216;p5&#8242;)); /* output = 255 &#8211; should be 1338! */</p>
<p>This is because in &#8220;decode&#8221; the line that caches the current decoded variable<br />
&#8220;cache[s] = decoded;&#8221; is working with a reversed version of the &#8220;s&#8221; parameter.</p>
<p>This can be corrected by having another variable which saves a copy of &#8220;s&#8221; before it&#8217;s reversed eg &#8220;t = s;&#8221;, then using &#8220;cache[t] = decoded;&#8221;</p>
<p>Cheers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to Create a Drupal Views Items Per Page Filter by Ian</title>
		<link>http://ianoxley.com/2010/09/23/how-to-create-a-drupal-views-items-per-page-filter/comment-page-1/#comment-10291</link>
		<dc:creator>Ian</dc:creator>
		<pubDate>Mon, 15 Aug 2011 22:15:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.strongasanox.co.uk/2010/09/23/how-to-create-a-drupal-views-items-per-page-filter/#comment-10291</guid>
		<description>I used it in a custom module. So yes, you would typically replace the &lt;em&gt;hook&lt;/em&gt; part of the function name with the name of the module e.g. in the &lt;code&gt;foo&lt;/code&gt; module the function name would be &lt;code&gt;views_query_alter(&amp;$view, &amp;$query)&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>I used it in a custom module. So yes, you would typically replace the <em>hook</em> part of the function name with the name of the module e.g. in the <code>foo</code> module the function name would be <code>views_query_alter(&amp;$view, &amp;$query)</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to Create a Drupal Views Items Per Page Filter by Frank</title>
		<link>http://ianoxley.com/2010/09/23/how-to-create-a-drupal-views-items-per-page-filter/comment-page-1/#comment-10188</link>
		<dc:creator>Frank</dc:creator>
		<pubDate>Wed, 10 Aug 2011 00:04:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.strongasanox.co.uk/2010/09/23/how-to-create-a-drupal-views-items-per-page-filter/#comment-10188</guid>
		<description>Could you please ellaborate a little more on how to implement your solution? Should this function be in template.php or in a custom module? The hook part of the function name should be replaced? Thanks</description>
		<content:encoded><![CDATA[<p>Could you please ellaborate a little more on how to implement your solution? Should this function be in template.php or in a custom module? The hook part of the function name should be replaced? Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on DIBI (Design It. Build It.) 2011 by Gavin Elliott</title>
		<link>http://ianoxley.com/2011/06/11/dibi-design-it-build-it-2011/comment-page-1/#comment-9044</link>
		<dc:creator>Gavin Elliott</dc:creator>
		<pubDate>Sun, 12 Jun 2011 16:38:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.strongasanox.co.uk/2011/06/11/dibi-design-it-build-it-2011/#comment-9044</guid>
		<description>Ian, thanks ever so much for the write-up. More importantly thank you for being there. It was good to finally meet you (in-real-life), glad you enjoyed the conference.

Gavin</description>
		<content:encoded><![CDATA[<p>Ian, thanks ever so much for the write-up. More importantly thank you for being there. It was good to finally meet you (in-real-life), glad you enjoyed the conference.</p>
<p>Gavin</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on A Show Grid Bookmarklet for the Drupal ninesixty Theme by derhasi</title>
		<link>http://ianoxley.com/2010/09/24/a-show-grid-bookmarklet-for-the-drupal-ninesixty-theme/comment-page-1/#comment-8666</link>
		<dc:creator>derhasi</dc:creator>
		<pubDate>Wed, 01 Jun 2011 19:15:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.strongasanox.co.uk/2010/09/24/a-show-grid-bookmarklet-for-the-drupal-ninesixty-theme/#comment-8666</guid>
		<description>Hi Ian,
thanks for the bookmarklet. Mentioned it in http://drupal.org/node/1175762 .

I worked out a smaller call using jquery:
&lt;code&gt;javascript:(function() {jQuery(&#039;body&#039;).toggleClass(&#039;show-grid&#039;);})();&lt;/code&gt;
For the moment I only tested it in chrome ... ;)</description>
		<content:encoded><![CDATA[<p>Hi Ian,<br />
thanks for the bookmarklet. Mentioned it in <a href="http://drupal.org/node/1175762" rel="nofollow">http://drupal.org/node/1175762</a> .</p>
<p>I worked out a smaller call using jquery:<br />
<code>javascript:(function() {jQuery('body').toggleClass('show-grid');})();</code><br />
For the moment I only tested it in chrome &#8230; <img src='http://ianoxley.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on That Yellow Highlight Colour in RGB and Hex by Jonathan</title>
		<link>http://ianoxley.com/2010/03/15/that-yellow-highlight-colour-in-rgb-and-hex/comment-page-1/#comment-6919</link>
		<dc:creator>Jonathan</dc:creator>
		<pubDate>Wed, 13 Apr 2011 16:26:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.strongasanox.co.uk/?p=311#comment-6919</guid>
		<description>this is the best pastel yellow color there is, mixed with the matching red and green and you&#039;ve got yourself a winner!</description>
		<content:encoded><![CDATA[<p>this is the best pastel yellow color there is, mixed with the matching red and green and you&#8217;ve got yourself a winner!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Detecting A Drupal Users First Login by Ian</title>
		<link>http://ianoxley.com/2010/08/05/detecting-a-drupal-users-first-login/comment-page-1/#comment-6663</link>
		<dc:creator>Ian</dc:creator>
		<pubDate>Sat, 26 Mar 2011 22:32:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.strongasanox.co.uk/2010/08/05/detecting-a-drupal-users-first-login/#comment-6663</guid>
		<description>Ah, good point - hadn&#039;t thought of that. The site I used this on was set to log a user in straight away once they&#039;d registered, hence the values being the same.</description>
		<content:encoded><![CDATA[<p>Ah, good point &#8211; hadn&#8217;t thought of that. The site I used this on was set to log a user in straight away once they&#8217;d registered, hence the values being the same.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Base58 Encoding in Python by Ian</title>
		<link>http://ianoxley.com/2011/03/11/base58-encoding-in-python/comment-page-1/#comment-6662</link>
		<dc:creator>Ian</dc:creator>
		<pubDate>Sat, 26 Mar 2011 22:24:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.strongasanox.co.uk/2011/03/11/base58-encoding-in-python/#comment-6662</guid>
		<description>Nice! Someday I might actually be able to make sense of those one-liners :)</description>
		<content:encoded><![CDATA[<p>Nice! Someday I might actually be able to make sense of those one-liners <img src='http://ianoxley.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Base58 Encoding in Python by Steve Anderson</title>
		<link>http://ianoxley.com/2011/03/11/base58-encoding-in-python/comment-page-1/#comment-6632</link>
		<dc:creator>Steve Anderson</dc:creator>
		<pubDate>Thu, 24 Mar 2011 15:44:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.strongasanox.co.uk/2011/03/11/base58-encoding-in-python/#comment-6632</guid>
		<description>Here&#039;s a version which is not necessarily easier to read (read &quot;not easier to read&quot;), but does some mapping and recursive shizzle. 

def encode(num):
        &quot;&quot;&quot; Returns num in a base58-encoded string &quot;&quot;&quot;
        num = max(num, 0)
        return &quot;%s%s&quot; % (encode(num / base_count), alphabet[num % base_count]) if num else &#039;&#039;

def decode(s):
        &quot;&quot;&quot; Decodes the base58-encoded string s into an integer &quot;&quot;&quot;
        return sum(map(lambda elem: base_count**elem[0] * alphabet.index(elem[1]), enumerate(s[::-1])))

It passes all your tests but I haven&#039;t checked it on anything else!</description>
		<content:encoded><![CDATA[<p>Here&#8217;s a version which is not necessarily easier to read (read &#8220;not easier to read&#8221;), but does some mapping and recursive shizzle. </p>
<p>def encode(num):<br />
        &#8220;&#8221;" Returns num in a base58-encoded string &#8220;&#8221;"<br />
        num = max(num, 0)<br />
        return &#8220;%s%s&#8221; % (encode(num / base_count), alphabet[num % base_count]) if num else &#8221;</p>
<p>def decode(s):<br />
        &#8220;&#8221;" Decodes the base58-encoded string s into an integer &#8220;&#8221;"<br />
        return sum(map(lambda elem: base_count**elem[0] * alphabet.index(elem[1]), enumerate(s[::-1])))</p>
<p>It passes all your tests but I haven&#8217;t checked it on anything else!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

