<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>Grayger &#187; Pyglet</title>
	<atom:link href="http://www.grayger.com/tag/pyglet/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.grayger.com</link>
	<description>In the pursuit of effectiveness</description>
	<lastBuildDate>Fri, 03 Sep 2010 14:52:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Bit Hacks</title>
		<link>http://www.grayger.com/python-eng/bit-hacks/</link>
		<comments>http://www.grayger.com/python-eng/bit-hacks/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 08:39:06 +0000</pubDate>
		<dc:creator>grayger</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Pyglet]]></category>

		<guid isPermaLink="false">http://www.grayger.com/wp/?p=169</guid>
		<description><![CDATA[I found a short code from pyglet source code. 


def _is_pow2(v):
    # http://graphics.stanford.edu/~seander/bithacks.html#DetermineIfPowerOf2
    return (v &#38; (v - 1)) == 0

At a glance, I can understand how it works, but I have never devised it!
It is from &#8220;Bit Hacks&#8221; by Sean Eron Anderson. They are not only beautiful but [...]]]></description>
			<content:encoded><![CDATA[<p>I found a short code from pyglet source code. </p>
<pre class="brush: python; ">

def _is_pow2(v):
    # http://graphics.stanford.edu/~seander/bithacks.html#DetermineIfPowerOf2
    return (v &amp; (v - 1)) == 0
</pre>
<p>At a glance, I can understand how it works, but I have never devised it!<br />
It is from <a href="http://graphics.stanford.edu/~seander/bithacks.html">&#8220;Bit Hacks&#8221;</a> by Sean Eron Anderson. They are not only beautiful but very useful in graphics libraries. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.grayger.com/python-eng/bit-hacks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
