<?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 on: Using Bitmasks to Efficiently Store Data</title>
	<atom:link href="http://mattsnider.com/languages/javascript/using-bitmasks-to-efficiently-store-data/feed/" rel="self" type="application/rss+xml" />
	<link>http://mattsnider.com/languages/javascript/using-bitmasks-to-efficiently-store-data/</link>
	<description>Understanding JavaScript and Frameworks</description>
	<pubDate>Tue, 06 Jan 2009 10:45:50 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: atish</title>
		<link>http://mattsnider.com/languages/javascript/using-bitmasks-to-efficiently-store-data/comment-page-1/#comment-16651</link>
		<dc:creator>atish</dc:creator>
		<pubDate>Wed, 18 Jun 2008 21:11:57 +0000</pubDate>
		<guid isPermaLink="false">http://mattsnider.com/languages/javascript/using-bitmasks-to-efficiently-store-data/#comment-16651</guid>
		<description>http://www.racketmag.com/images/cookiecrisp.jpg</description>
		<content:encoded><![CDATA[<p><a href="http://www.racketmag.com/images/cookiecrisp.jpg" rel="nofollow">http://www.racketmag.com/images/cookiecrisp.jpg</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Snider</title>
		<link>http://mattsnider.com/languages/javascript/using-bitmasks-to-efficiently-store-data/comment-page-1/#comment-16580</link>
		<dc:creator>Matt Snider</dc:creator>
		<pubDate>Tue, 17 Jun 2008 05:34:09 +0000</pubDate>
		<guid isPermaLink="false">http://mattsnider.com/languages/javascript/using-bitmasks-to-efficiently-store-data/#comment-16580</guid>
		<description>Thanks pawel. I thought that JavaScript supported binary operations, but when I setup a few test scripts, it didn't work. I tried again today, and it worked just fine. I have upgraded the BitWriter script to properly use binary operators.</description>
		<content:encoded><![CDATA[<p>Thanks pawel. I thought that JavaScript supported binary operations, but when I setup a few test scripts, it didn&#8217;t work. I tried again today, and it worked just fine. I have upgraded the BitWriter script to properly use binary operators.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pawel</title>
		<link>http://mattsnider.com/languages/javascript/using-bitmasks-to-efficiently-store-data/comment-page-1/#comment-16572</link>
		<dc:creator>pawel</dc:creator>
		<pubDate>Mon, 16 Jun 2008 13:16:15 +0000</pubDate>
		<guid isPermaLink="false">http://mattsnider.com/languages/javascript/using-bitmasks-to-efficiently-store-data/#comment-16572</guid>
		<description>ouch, once ahgain:
hasBitmask : function(n){ 
return ( isValidBitmask(n) &#38;&#38; n &#60;= bit &#38;&#38; ((bit &#38; n) == n)) ? true : false 
}</description>
		<content:encoded><![CDATA[<p>ouch, once ahgain:<br />
hasBitmask : function(n){<br />
return ( isValidBitmask(n) &amp;&amp; n &lt;= bit &amp;&amp; ((bit &amp; n) == n)) ? true : false<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pawel</title>
		<link>http://mattsnider.com/languages/javascript/using-bitmasks-to-efficiently-store-data/comment-page-1/#comment-16571</link>
		<dc:creator>pawel</dc:creator>
		<pubDate>Mon, 16 Jun 2008 13:07:45 +0000</pubDate>
		<guid isPermaLink="false">http://mattsnider.com/languages/javascript/using-bitmasks-to-efficiently-store-data/#comment-16571</guid>
		<description>What's the reason to "simulate '&#38;' (or '&#124;' or '^') binary operator in other languages" instead of actually using binary operators?

/* will work for up to 256 stored values. 
you can use any power of 2 if you need more/less "slots" */
isValidBitmask = function(n){ 
return (n&#62;0) &#38;&#38; !(256%n) 
}

/* this is just an example of how I'd write hasBitmask function*/
hasBitmask : function(n){ 
return ( isValidBitmask(n) &#38;&#38; n </description>
		<content:encoded><![CDATA[<p>What&#8217;s the reason to &#8220;simulate &#8216;&amp;&#8217; (or &#8216;|&#8217; or &#8216;^&#8217;) binary operator in other languages&#8221; instead of actually using binary operators?</p>
<p>/* will work for up to 256 stored values.<br />
you can use any power of 2 if you need more/less &#8220;slots&#8221; */<br />
isValidBitmask = function(n){<br />
return (n&gt;0) &amp;&amp; !(256%n)<br />
}</p>
<p>/* this is just an example of how I&#8217;d write hasBitmask function*/<br />
hasBitmask : function(n){<br />
return ( isValidBitmask(n) &amp;&amp; n</p>
]]></content:encoded>
	</item>
</channel>
</rss>
