<?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>Refactored scope</title>
	<atom:link href="http://ominian.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ominian.com</link>
	<description>PyMethius project notes</description>
	<lastBuildDate>Sun, 06 May 2012 05:03:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>CraftJS; interesting potential</title>
		<link>http://ominian.com/2012/05/05/craftjs-interesting-potential/</link>
		<comments>http://ominian.com/2012/05/05/craftjs-interesting-potential/#comments</comments>
		<pubDate>Sun, 06 May 2012 05:01:27 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[canvas]]></category>
		<category><![CDATA[Game development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[brain_dump]]></category>

		<guid isPermaLink="false">http://ominian.com/?p=194</guid>
		<description><![CDATA[The other month/week I resumed some dabbling/hacking experiments in working with HTML5&#8242;s canvas. This go around, I decided to give CraftyJS a try. The short version of my experiments, CraftyJS has a lot of potential if it can get it&#8217;s memory leaks under control, which might be a daunting task. Here&#8217;s the example Pong game <a href='http://ominian.com/2012/05/05/craftjs-interesting-potential/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>The other month/week I resumed some dabbling/hacking experiments in working with HTML5&#8242;s canvas.  This go around, I decided to give CraftyJS a try.</p>
<p>The short version of my experiments, CraftyJS has a lot of potential if it can get it&#8217;s memory leaks under control, which might be a daunting task.  </p>
<p>Here&#8217;s the example Pong game implementation that can be found on CraftyJS&#8217;s website:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&nbsp;
Crafty.<span style="color: #660066;">init</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">600</span><span style="color: #339933;">,</span><span style="color: #CC0000;">300</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
Crafty.<span style="color: #660066;">background</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;rgb(127,127,127)&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">//Paddles</span>
Crafty.<span style="color: #660066;">e</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Paddle, 2D, DOM, Color, Multiway&quot;</span><span style="color: #009900;">&#41;</span>
    .<span style="color: #660066;">color</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'rgb(255,0,0)'</span><span style="color: #009900;">&#41;</span>
    .<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> x<span style="color: #339933;">:</span> <span style="color: #CC0000;">20</span><span style="color: #339933;">,</span> y<span style="color: #339933;">:</span> <span style="color: #CC0000;">100</span><span style="color: #339933;">,</span> w<span style="color: #339933;">:</span> <span style="color: #CC0000;">10</span><span style="color: #339933;">,</span> h<span style="color: #339933;">:</span> <span style="color: #CC0000;">100</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
    .<span style="color: #660066;">multiway</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">4</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> W<span style="color: #339933;">:</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">90</span><span style="color: #339933;">,</span> S<span style="color: #339933;">:</span> <span style="color: #CC0000;">90</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
Crafty.<span style="color: #660066;">e</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Paddle, 2D, DOM, Color, Multiway&quot;</span><span style="color: #009900;">&#41;</span>
    .<span style="color: #660066;">color</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'rgb(0,255,0)'</span><span style="color: #009900;">&#41;</span>
    .<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> x<span style="color: #339933;">:</span> <span style="color: #CC0000;">580</span><span style="color: #339933;">,</span> y<span style="color: #339933;">:</span> <span style="color: #CC0000;">100</span><span style="color: #339933;">,</span> w<span style="color: #339933;">:</span> <span style="color: #CC0000;">10</span><span style="color: #339933;">,</span> h<span style="color: #339933;">:</span> <span style="color: #CC0000;">100</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
    .<span style="color: #660066;">multiway</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">4</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> UP_ARROW<span style="color: #339933;">:</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">90</span><span style="color: #339933;">,</span> DOWN_ARROW<span style="color: #339933;">:</span> <span style="color: #CC0000;">90</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">//Ball</span>
Crafty.<span style="color: #660066;">e</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;2D, DOM, Color, Collision&quot;</span><span style="color: #009900;">&#41;</span>
    .<span style="color: #660066;">color</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'rgb(0,0,255)'</span><span style="color: #009900;">&#41;</span>
    .<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> x<span style="color: #339933;">:</span> <span style="color: #CC0000;">300</span><span style="color: #339933;">,</span> y<span style="color: #339933;">:</span> <span style="color: #CC0000;">150</span><span style="color: #339933;">,</span> w<span style="color: #339933;">:</span> <span style="color: #CC0000;">10</span><span style="color: #339933;">,</span> h<span style="color: #339933;">:</span> <span style="color: #CC0000;">10</span><span style="color: #339933;">,</span>
            dX<span style="color: #339933;">:</span> Crafty.<span style="color: #660066;">math</span>.<span style="color: #660066;">randomInt</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">2</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
            dY<span style="color: #339933;">:</span> Crafty.<span style="color: #660066;">math</span>.<span style="color: #660066;">randomInt</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">2</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">5</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
    .<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'EnterFrame'</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: #006600; font-style: italic;">//hit floor or roof</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">y</span> <span style="color: #339933;">&lt;=</span> <span style="color: #CC0000;">0</span> <span style="color: #339933;">||</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">y</span> <span style="color: #339933;">&gt;=</span> <span style="color: #CC0000;">290</span><span style="color: #009900;">&#41;</span>
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">dY</span> <span style="color: #339933;">*=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">x</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">600</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">x</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">300</span><span style="color: #339933;">;</span>
            Crafty<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;LeftPoints&quot;</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><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">++</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">points</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; Points&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#125;</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><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">x</span> <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">10</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">x</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">300</span><span style="color: #339933;">;</span>
            Crafty<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;RightPoints&quot;</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><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">++</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">points</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; Points&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#125;</span><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;">this</span>.<span style="color: #660066;">x</span> <span style="color: #339933;">+=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">dX</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">y</span> <span style="color: #339933;">+=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">dY</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
    .<span style="color: #660066;">onHit</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Paddle'</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;">this</span>.<span style="color: #660066;">dX</span> <span style="color: #339933;">*=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">//Score boards</span>
Crafty.<span style="color: #660066;">e</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;LeftPoints, DOM, 2D, Text&quot;</span><span style="color: #009900;">&#41;</span>
    .<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> x<span style="color: #339933;">:</span> <span style="color: #CC0000;">20</span><span style="color: #339933;">,</span> y<span style="color: #339933;">:</span> <span style="color: #CC0000;">20</span><span style="color: #339933;">,</span> w<span style="color: #339933;">:</span> <span style="color: #CC0000;">100</span><span style="color: #339933;">,</span> h<span style="color: #339933;">:</span> <span style="color: #CC0000;">20</span><span style="color: #339933;">,</span> points<span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
    .<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;0 Points&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
Crafty.<span style="color: #660066;">e</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;RightPoints, DOM, 2D, Text&quot;</span><span style="color: #009900;">&#41;</span>
    .<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> x<span style="color: #339933;">:</span> <span style="color: #CC0000;">515</span><span style="color: #339933;">,</span> y<span style="color: #339933;">:</span> <span style="color: #CC0000;">20</span><span style="color: #339933;">,</span> w<span style="color: #339933;">:</span> <span style="color: #CC0000;">100</span><span style="color: #339933;">,</span> h<span style="color: #339933;">:</span> <span style="color: #CC0000;">20</span><span style="color: #339933;">,</span> points<span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
    .<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;0 Points&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Now I will break this down.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">Crafty.<span style="color: #660066;">init</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">600</span><span style="color: #339933;">,</span><span style="color: #CC0000;">300</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
Crafty.<span style="color: #660066;">background</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;rgb(127,127,127)&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Relatively straight forward; this generates a HTML5 canvas element of 600&#215;300 pixels, sets the color to a neutral color range.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">Crafty.<span style="color: #660066;">e</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Paddle, 2D, DOM, Color, Multiway&quot;</span><span style="color: #009900;">&#41;</span>
    .<span style="color: #660066;">color</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'rgb(255,0,0)'</span><span style="color: #009900;">&#41;</span>
    .<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> x<span style="color: #339933;">:</span> <span style="color: #CC0000;">20</span><span style="color: #339933;">,</span> y<span style="color: #339933;">:</span> <span style="color: #CC0000;">100</span><span style="color: #339933;">,</span> w<span style="color: #339933;">:</span> <span style="color: #CC0000;">10</span><span style="color: #339933;">,</span> h<span style="color: #339933;">:</span> <span style="color: #CC0000;">100</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
    .<span style="color: #660066;">multiway</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">4</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> W<span style="color: #339933;">:</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">90</span><span style="color: #339933;">,</span> S<span style="color: #339933;">:</span> <span style="color: #CC0000;">90</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Part of Crafty&#8217;s cleverness is in it&#8217;s component based entity system.  The first line tells the Crafty library that you&#8217;re defining a new entity called &#8220;Paddle&#8221; which is a 2D, DOM behavior like, color&#8217;d objected that reacts to multiple user inputs.   Break down:</p>
<p>.color(&#8230;) defines the paddles color<br />
.attr(&#8230;) defines the entities dimensions AND position.<br />
.<a href="http://craftyjs.com/api/Multiway.html">multiway</a>(&#8230;) is a clear API method which states<br />
the entities movement speed, and then which direction a triggered keyboard input will send the entitiy.  So in the above case W is north, and S is south.</p>
<p>Skipping the other paddle, we come to the ball in a pong game.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">Crafty.<span style="color: #660066;">e</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;2D, DOM, Color, Collision&quot;</span><span style="color: #009900;">&#41;</span>
    .<span style="color: #660066;">color</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'rgb(0,0,255)'</span><span style="color: #009900;">&#41;</span>
    .<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> x<span style="color: #339933;">:</span> <span style="color: #CC0000;">300</span><span style="color: #339933;">,</span> y<span style="color: #339933;">:</span> <span style="color: #CC0000;">150</span><span style="color: #339933;">,</span> w<span style="color: #339933;">:</span> <span style="color: #CC0000;">10</span><span style="color: #339933;">,</span> h<span style="color: #339933;">:</span> <span style="color: #CC0000;">10</span><span style="color: #339933;">,</span>
            dX<span style="color: #339933;">:</span> Crafty.<span style="color: #660066;">math</span>.<span style="color: #660066;">randomInt</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">2</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
            dY<span style="color: #339933;">:</span> Crafty.<span style="color: #660066;">math</span>.<span style="color: #660066;">randomInt</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">2</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">5</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
    .<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'EnterFrame'</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: #006600; font-style: italic;">//hit floor or roof</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">y</span> <span style="color: #339933;">&lt;=</span> <span style="color: #CC0000;">0</span> <span style="color: #339933;">||</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">y</span> <span style="color: #339933;">&gt;=</span> <span style="color: #CC0000;">290</span><span style="color: #009900;">&#41;</span>
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">dY</span> <span style="color: #339933;">*=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">x</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">600</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">x</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">300</span><span style="color: #339933;">;</span>
            Crafty<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;LeftPoints&quot;</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><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">++</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">points</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; Points&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#125;</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><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">x</span> <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">10</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">x</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">300</span><span style="color: #339933;">;</span>
            Crafty<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;RightPoints&quot;</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><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">++</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">points</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; Points&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#125;</span><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;">this</span>.<span style="color: #660066;">x</span> <span style="color: #339933;">+=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">dX</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">y</span> <span style="color: #339933;">+=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">dY</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
    .<span style="color: #660066;">onHit</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Paddle'</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;">this</span>.<span style="color: #660066;">dX</span> <span style="color: #339933;">*=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>Something I glossed over, Crafty&#8217;s e(&#8230;) function is actually a Javascript prototype class generator.  It&#8217;s important to note that because of the interplay between .attr() and every other post e(&#8230;) method call.</p>
<p>In the above</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> x<span style="color: #339933;">:</span> <span style="color: #CC0000;">300</span><span style="color: #339933;">,</span> y<span style="color: #339933;">:</span> <span style="color: #CC0000;">150</span><span style="color: #339933;">,</span> w<span style="color: #339933;">:</span> <span style="color: #CC0000;">10</span><span style="color: #339933;">,</span> h<span style="color: #339933;">:</span> <span style="color: #CC0000;">10</span><span style="color: #339933;">,</span>
            dX<span style="color: #339933;">:</span> Crafty.<span style="color: #660066;">math</span>.<span style="color: #660066;">randomInt</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">2</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
            dY<span style="color: #339933;">:</span> Crafty.<span style="color: #660066;">math</span>.<span style="color: #660066;">randomInt</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">2</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">5</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>defines additional properties of the entity.  x/y &#038; w/h are already used by the 2D and DOM components to determine the entities position on but in the later .bind(&#8220;EnterFrame&#8221;) notice that the logic involved is referencing this attributes.</p>
<p>So inside the EnterFrame handler for the Ball are two crucial sections.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">x</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">600</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">x</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">300</span><span style="color: #339933;">;</span>
            Crafty<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;LeftPoints&quot;</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><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">++</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">points</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; Points&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#125;</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><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">x</span> <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">10</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">x</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">300</span><span style="color: #339933;">;</span>
            Crafty<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;RightPoints&quot;</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><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">++</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">points</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; Points&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;</span>pre<span style="color: #339933;">&gt;</span>
&nbsp;
These two <span style="color: #000066; font-weight: bold;">if</span> clauses handle bounds check<span style="color: #3366CC;">'s and then depending on position award the appropriate side a point.
&nbsp;
Notice the Crafty(&quot;&quot;) calls.  In this case Crafty(&quot;LeftPoints&quot;) calls up the appropriate entity or entities ( in this case there are only 1 per side ) and applies a closure to increment the winning side'</span>s <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">points</span> and body text.
&nbsp;
&nbsp;
<span style="color: #660066;">The</span> other crucial section <span style="color: #000066; font-weight: bold;">is</span> the <span style="color: #CC0000;">2</span> line closure 
&nbsp;
<span style="color: #339933;">&lt;</span>pre lang<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;javascript&quot;</span><span style="color: #339933;">&gt;</span>
.<span style="color: #660066;">onHit</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Paddle'</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;">this</span>.<span style="color: #660066;">dX</span> <span style="color: #339933;">*=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>A fairly cool concept in Crafty is that collision detection between almost any entity is dealt with by Crafty, so to determine if the Ball hits a paddle, you just have to ask Crafty.</p>
<h3>Summary</h3>
<p>I was fairly impressed with CraftyJS, it is very much the spiritual relative of jQuery for a dirt simple and comfortably clever API.  Unfortunately Crafty can blind side you with it&#8217;s cleverness if you&#8217;re not careful.  What I mean is that in experimenting with CraftyJS I found it fairly easy to create non-obvious memory leaks and or abuse closures to much.</p>
<p>Still it&#8217;s a fairly nice library and though this post is slightly long, I am only covering a thin scratch of the depth that is in CraftJS.  This could be a fantastic building stage for making a slew of quick and dirty games.</p>
]]></content:encoded>
			<wfw:commentRss>http://ominian.com/2012/05/05/craftjs-interesting-potential/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trial&#8217;s &amp; Tribulations with Apple push notification</title>
		<link>http://ominian.com/2012/05/04/trials-tribulations-with-apple-push-notification/</link>
		<comments>http://ominian.com/2012/05/04/trials-tribulations-with-apple-push-notification/#comments</comments>
		<pubDate>Fri, 04 May 2012 16:46:56 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ominian.com/?p=192</guid>
		<description><![CDATA[So far really not impressed with Apple&#8217;s APN service, especially it&#8217;s sandbox/development tier. To get started, I recommend reading the Founder/CTO of Server Density&#8217;s recipe/guide to getting started with APN, here ( http://blog.serverdensity.com/2009/07/10/how-to-build-an-apple-push-notification-provider-server-tutorial/ ) Because of how many times I had to clean slate my dev. environment, I tried to streamline the process of converting <a href='http://ominian.com/2012/05/04/trials-tribulations-with-apple-push-notification/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>So far really not impressed with Apple&#8217;s APN service, especially it&#8217;s sandbox/development tier.</p>
<p>To get started, I recommend reading the Founder/CTO of Server Density&#8217;s recipe/guide to getting started with APN, <a href="http://blog.serverdensity.com/2009/07/10/how-to-build-an-apple-push-notification-provider-server-tutorial/">here</a> ( http://blog.serverdensity.com/2009/07/10/how-to-build-an-apple-push-notification-provider-server-tutorial/ )</p>
<p>Because of how many times I had to clean slate my dev. environment, I tried to streamline the process of converting the APN certificate and my private key.  In the process of converting the private key to pem format, you do have to provide a pass phrase.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Convert certificate&quot;</span>
openssl pkcs12 <span style="color: #660033;">-clcerts</span> <span style="color: #660033;">-nokeys</span> <span style="color: #660033;">-out</span> apns-dev-cert.pem <span style="color: #660033;">-in</span> apns-dev-cert.p12
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Converting key&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;You must provide a PEM phrase, it will be stripped out in next step&quot;</span>
openssl pkcs12 <span style="color: #660033;">-nocerts</span> <span style="color: #660033;">-out</span> apns-dev-key.pem <span style="color: #660033;">-in</span> apns-dev-key.p12
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Stripping off PEM phrase&quot;</span>
openssl rsa <span style="color: #660033;">-in</span> apns-dev-key.pem <span style="color: #660033;">-out</span> apns-dev-key-noenc.pem
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Concatenating keys&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">cat</span> apns-dev-cert.pem apns-dev-key-noenc.pem <span style="color: #000000; font-weight: bold;">&gt;</span> apns-dev.pem</pre></div></div>

<p>One SERIOUS word of warning about APN is a scenario where you *known* beyond a shadow of a doubt that your APN requests are properly formed and the TLS connection works as expected but nothing happens.  To repeat, everything looks like it works but you don&#8217;t get any APN&#8217;s to your device.  My advice is to delete your APN certificate from your keychain and re-download the APN certificate, convert it again, and try again.  </p>
<p>To verify your key is correct, the command line openssl utility is somewhat invaluable</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"> openssl s_client <span style="color: #660033;">-connect</span> gateway.sandbox.push.apple.com:<span style="color: #000000;">2195</span> <span style="color: #660033;">-cert</span> apns-dev-cert.pem <span style="color: #660033;">-key</span> apns-dev-key-noenc.pem</pre></div></div>

<p>There should be no errors and the console should hang immediately after the &#8212; line until you type in some garbage.</p>
<h2>Apple: Anti-developer</h2>
<p> As I said earlier, I am really not impressed with APN for one specific reason.  I lost about 4-5 hours of my life yesterday trying various different APN libraries for PHP, Ruby, Python, and objective-c.  My payload to APN was correct, my token ID was triple verified, and I was sure I was sending the data down the wire.  Meanwhile I got no error messages or warnings that my certificate was out of date/order and because of that my APN requests were being ignored.</p>
<p>The worst technology on the planet isn&#8217;t that what gives ambigious/cryptic error messages but that which just silently fails with no means to diagnose the problem.  Hell it&#8217;s worse that the infamous &#8220;There was an error, somewhere, sometime.&#8221; joke. </p>
]]></content:encoded>
			<wfw:commentRss>http://ominian.com/2012/05/04/trials-tribulations-with-apple-push-notification/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Selective Dropbox sync for Ubuntu</title>
		<link>http://ominian.com/2012/04/05/selective-sync-for-ubuntu/</link>
		<comments>http://ominian.com/2012/04/05/selective-sync-for-ubuntu/#comments</comments>
		<pubDate>Thu, 05 Apr 2012 22:36:13 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ominian.com/?p=190</guid>
		<description><![CDATA[Find a good tutorial to setup the CLI Dropbox agent &#8211; This one is the most concise IMO Grab this http://www.dropbox.com/download?dl=packages/dropbox.py `dropbox.py exclude add` is the command you need Say I&#8217;ve got 30+ directories in my dropbox but I only want &#8220;md&#8221; find -maxdepth 1 -type d &#124; cut -b3 &#124; grep -v md &#124; xargs <a href='http://ominian.com/2012/04/05/selective-sync-for-ubuntu/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<ol>
<li>Find a good tutorial to setup the CLI Dropbox agent &#8211; <a href="http://ubuntuservergui.com/ubuntu-server-guide/install-dropbox-ubuntu-server">This one</a> is the most concise IMO</li>
<li>Grab this http://www.dropbox.com/download?dl=packages/dropbox.py</li>
<li>`dropbox.py exclude add` is the command you need</li>
</ol>
<p>Say I&#8217;ve got 30+ directories in my dropbox but I only want &#8220;md&#8221;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">  <span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #660033;">-maxdepth</span> <span style="color: #000000;">1</span> <span style="color: #660033;">-type</span> d <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> -b3 <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-v</span> md <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">xargs</span> python md<span style="color: #000000; font-weight: bold;">/</span>dropbox.py exclude add</pre></div></div>

<p>That will add everything else to the exclusion list AND clean out the local Dropbox path for you.  One point to note is that .dropbox-cache/ gets hoovered into the exclusion list, which is redundant and doesn&#8217;t appear to cause any harm.</p>
<p>I&#8217;ve increasingly been using Dropbox as a low-security transfer protocol ( critical things like ssh keys, password dictionaries, and certificates are handled separately ) and now with the selective sync it&#8217;s becoming fairly trivial to keep my horde of virtual servers both in house and running on AWS synced.  One thing I&#8217;ve been trying out is using the autostart functionality to kick on when I login to a box.  I am not sure but if Dropbox could kick on only when I am logged in would be fairly nice.</p>
]]></content:encoded>
			<wfw:commentRss>http://ominian.com/2012/04/05/selective-sync-for-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PyCon 2012 Day 1 itinerary</title>
		<link>http://ominian.com/2012/03/09/pycon-2012-day-1-itinerary/</link>
		<comments>http://ominian.com/2012/03/09/pycon-2012-day-1-itinerary/#comments</comments>
		<pubDate>Fri, 09 Mar 2012 07:21:13 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ominian.com/?p=187</guid>
		<description><![CDATA[Graph Processing in Python Scalability at YouTube Practical Machine Learning in Python LUNCH Code Generation in Python: Dismantling Jinja The Magic of Metaprogramming Throwing Together Distributed Services With Gevent Putting Python in PostgreSQL And I think that ends day 1 of the conference. Mostly I am hoping to combine what I learn in the Graph <a href='http://ominian.com/2012/03/09/pycon-2012-day-1-itinerary/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p><a href="https://us.pycon.org/2012/schedule/presentation/225/">Graph Processing in Python</a><br />
<a href="https://us.pycon.org/2012/schedule/presentation/128/">Scalability at YouTube</a><br />
<a href="https://us.pycon.org/2012/schedule/presentation/119/" target="_blank">Practical Machine Learning in Python</a><br />
LUNCH<br />
<a href="https://us.pycon.org/2012/schedule/presentation/246/" target="_blank">Code Generation in Python: Dismantling Jinja</a><br />
<a href="https://us.pycon.org/2012/schedule/presentation/45/" target="_blank">The Magic of Metaprogramming</a><br />
<a href="https://us.pycon.org/2012/schedule/presentation/288/" target="_blank">Throwing Together Distributed Services With Gevent</a><br />
<a href="https://us.pycon.org/2012/schedule/presentation/77/" target="_blank">Putting Python in PostgreSQL</a></p>
<p>And I think that ends day 1 of the conference.  Mostly I am hoping to combine what I learn in the Graph processing and Practical ML talks, while having an overview of code generation might be a solution ( or a new problem ) to my current client&#8217;s issues.  As for metaprogramming, gevent, and postgreSQL; those just seem fun.</p>
]]></content:encoded>
			<wfw:commentRss>http://ominian.com/2012/03/09/pycon-2012-day-1-itinerary/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Off to PyCon 2012</title>
		<link>http://ominian.com/2012/03/08/off-to-pycon-2012/</link>
		<comments>http://ominian.com/2012/03/08/off-to-pycon-2012/#comments</comments>
		<pubDate>Thu, 08 Mar 2012 18:43:58 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ominian.com/?p=186</guid>
		<description><![CDATA[Still trying to figure out what presentations I want to go to, but I am genuinely excited to be attending another PyCon, this time around in California. Also looking forward to seeing startup row to see what wonderful things are being built with Python this year around.]]></description>
			<content:encoded><![CDATA[<p>  Still trying to figure out what presentations I want to go to, but I am genuinely excited to be attending another PyCon, this time around in California.  Also looking forward to seeing startup row to see what wonderful things are being built with Python this year around.</p>
]]></content:encoded>
			<wfw:commentRss>http://ominian.com/2012/03/08/off-to-pycon-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update a Github Fork from the Original Repo</title>
		<link>http://ominian.com/2012/03/02/update-a-github-fork-from-the-original-repo/</link>
		<comments>http://ominian.com/2012/03/02/update-a-github-fork-from-the-original-repo/#comments</comments>
		<pubDate>Fri, 02 Mar 2012 22:20:27 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ominian.com/?p=184</guid>
		<description><![CDATA[I have a few forked repo&#8217;s, either because I needed to make some unique and custom change to the project or because I wanted a safe snapshot in time of the project. Occasionally I&#8217;d like to update these forks against their master and the Google has provided a very concise blog post here(http://bradlyfeeley.com/2008/09/03/update-a-github-fork-from-the-original-repo/). Kudo&#8217;s to <a href='http://ominian.com/2012/03/02/update-a-github-fork-from-the-original-repo/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>I have a few forked repo&#8217;s, either because I needed to make some unique and custom change to the project or because I wanted a safe snapshot in time of the project.</p>
<p>Occasionally I&#8217;d like to update these forks against their master and the Google has provided a very concise blog post <a href="http://bradlyfeeley.com/2008/09/03/update-a-github-fork-from-the-original-repo/" title="http://bradlyfeeley.com/2008/09/03/update-a-github-fork-from-the-original-repo/" target="_blank">here(http://bradlyfeeley.com/2008/09/03/update-a-github-fork-from-the-original-repo/)</a>.  Kudo&#8217;s to Bradly Feeley.</p>
]]></content:encoded>
			<wfw:commentRss>http://ominian.com/2012/03/02/update-a-github-fork-from-the-original-repo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sencha Touch v2 with style</title>
		<link>http://ominian.com/2012/02/06/sencha-touch-v2-with-style/</link>
		<comments>http://ominian.com/2012/02/06/sencha-touch-v2-with-style/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 17:56:10 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[sencha-touch]]></category>
		<category><![CDATA[compass]]></category>
		<category><![CDATA[ExtJS]]></category>
		<category><![CDATA[sass]]></category>

		<guid isPermaLink="false">http://ominian.com/?p=182</guid>
		<description><![CDATA[You wouldn&#8217;t write a HTML form like this: &#60;form style=&#34;radius-border:12px; border: thin solid black; background-color: blue&#34;&#62; &#60;label style=&#34;background: none !important; width: 45%&#34; &#62;Username&#60;/label&#62; &#60;input style=&#34;background-color: white !important; border: thin solid white !important&#34; name=&#34;username&#34;/&#62;&#60;br/&#62; &#160; &#60;label style=&#34;background: none !important; width: 45%&#34;&#62;Password&#60;/label&#62; &#60;input style=&#34;background-color: white !important; border: thin solid white !important&#34; type=&#34;password&#34; name=&#34;password&#34;/&#62;&#60;br/&#62; &#160; &#60;input type=&#34;submit&#34;/&#62; &#60;/form&#62; <a href='http://ominian.com/2012/02/06/sencha-touch-v2-with-style/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>You wouldn&#8217;t write a HTML form like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;form style=&quot;radius-border:12px; border: thin solid black; background-color: blue&quot;&gt;
    &lt;label style=&quot;background: none !important; width: 45%&quot; &gt;Username&lt;/label&gt;
    &lt;input style=&quot;background-color: white !important; border: thin solid white !important&quot; name=&quot;username&quot;/&gt;&lt;br/&gt;
&nbsp;
    &lt;label style=&quot;background: none !important; width: 45%&quot;&gt;Password&lt;/label&gt;
    &lt;input style=&quot;background-color: white !important; border: thin solid white !important&quot; type=&quot;password&quot; name=&quot;password&quot;/&gt;&lt;br/&gt;
&nbsp;
    &lt;input type=&quot;submit&quot;/&gt;
&lt;/form&gt;</pre></div></div>

<p>So why the hell would you write a Sencha Touch form like</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">Ext.<span style="color: #660066;">define</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;SoopaForm&quot;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
   config<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
         style<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;radius-border:12px; border: thin solid black; background-color: blue&quot;</span><span style="color: #339933;">,</span>
         items<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span>
             <span style="color: #009900;">&#123;</span>
                xtype<span style="color: #339933;">:</span> <span style="color: #3366CC;">'textfield'</span><span style="color: #339933;">,</span>
                <span style="color: #000066;">name</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'username'</span><span style="color: #339933;">,</span>
                label<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Username'</span><span style="color: #339933;">,</span>
                labelStyle<span style="color: #339933;">:</span> <span style="color: #3366CC;">'background: none !important; width: 45%'</span><span style="color: #339933;">,</span>
                style<span style="color: #339933;">:</span> <span style="color: #3366CC;">'background-color: white !important; border: thin solid white !important'</span>
             <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
             <span style="color: #009900;">&#123;</span>
                xtype<span style="color: #339933;">:</span> <span style="color: #3366CC;">'passwordfield'</span><span style="color: #339933;">,</span>
                <span style="color: #000066;">name</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'password'</span><span style="color: #339933;">,</span>
                label<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Password'</span><span style="color: #339933;">,</span>
                labelStyle<span style="color: #339933;">:</span> <span style="color: #3366CC;">'background: none !important; width: 45%'</span><span style="color: #339933;">,</span>
                style<span style="color: #339933;">:</span> <span style="color: #3366CC;">'background-color: white !important; border: thin solid white !important'</span>
             <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
             <span style="color: #009900;">&#123;</span>
                  xtype<span style="color: #339933;">:</span> <span style="color: #3366CC;">'button'</span><span style="color: #339933;">,</span>
                  text<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Submit'</span><span style="color: #339933;">,</span>
                  action<span style="color: #339933;">:</span> <span style="color: #3366CC;">'submit'</span>
             <span style="color: #009900;">&#125;</span>
&nbsp;
         <span style="color: #009900;">&#93;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>ExtJS 4 AND Sencha Touch 2 come with a feature complete <a href="http://sass-lang.com/">Sass</a>/<a href="http://compass-style.org/">Compass </a> sencha-touch css package ( just need to ruby gem install sass &#038; compass ).   From there, you can easily style your ExtJS4/Touch UI with some housekeeping similar to compass watch ( background polling compile on detection system ).  You&#8217;re business logic will be cleaner, you styling will be more consistent, and more importantly it will make you totally look like a badass when you restyle an entire mobile app in minutes instead of days.</p>
]]></content:encoded>
			<wfw:commentRss>http://ominian.com/2012/02/06/sencha-touch-v2-with-style/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Tour de Force with Sencha Touch v2</title>
		<link>http://ominian.com/2012/02/03/a-tour-de-force-with-sencha-touch-v2/</link>
		<comments>http://ominian.com/2012/02/03/a-tour-de-force-with-sencha-touch-v2/#comments</comments>
		<pubDate>Fri, 03 Feb 2012 23:08:24 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ominian.com/?p=181</guid>
		<description><![CDATA[The team I am working with just passed the 1,000 man hour mark on a flagship Mobile application using Sencha Touch version 2 pr3 and phone gap. Until the business people make a PR statement I can&#8217;t say much&#8230; so in the interim, things I&#8217;ve discovered. Don&#8217;t trust Ext.Loader to get it right &#8211; eventually <a href='http://ominian.com/2012/02/03/a-tour-de-force-with-sencha-touch-v2/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>The team I am working with just passed the 1,000 man hour mark on a flagship Mobile application using Sencha Touch version 2 pr3 and phone gap.  Until the business people make a PR statement I can&#8217;t say much&#8230; so in the interim, things I&#8217;ve discovered.</p>
<ol>
<li>Don&#8217;t trust Ext.Loader to get it right &#8211; eventually using some cheap tricks I wrote an automatic dependancy handler that writes script tags in the correct order for all needed components.  Holding @ 12K lines of JS and the &#8220;good&#8221; mobile devices are performent</li>
<li> Ext.layout.Vbox will test your sanity &#8211; http://www.sencha.com/forum/showthread.php?140185-vbox-gives-components-0-height-hbox-gives-components-0-width  Their is a provided solution but I&#8217;ve found it&#8217;s best to use a Ext.env or Ext.os controlled magic height/width variables instead of relying soley on the rendering logic to get it right</li>
<li> I re-implemented <a href="http://dev.sencha.com/deploy/ext-4.0.7-gpl/examples/simple-widgets/progress-bar.html">this ExtJS 4 widget </a>in Sencha Touch 2.  My original estimate was 2.5 hours but that became 12 hours later to learn the Ext.component system to get it right.  At this point I&#8217;ve read 60% of Sencha Touch&#8217;s source code, line by line, so I guess this was a positive serendipity tour.  That said, you&#8217;re going to pay dearly to make exotic custom components until some more tools are ported from ExtJS4 to Sencha Touch</li>
<li> Last, Android&#8217;s mobile rendering engine is the MSIE of Smart phones.</li>
</ol>
<p>On a sadder note, I am finally breaking down and purchasing an Apple computing device of some sort as the jail break toolchain I&#8217;ve got isn&#8217;t exactly professional grade.</p>
]]></content:encoded>
			<wfw:commentRss>http://ominian.com/2012/02/03/a-tour-de-force-with-sencha-touch-v2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pynarcissus parser post-parse analysis with a visitor like pattern</title>
		<link>http://ominian.com/2012/01/11/pynarcissus-parser-post-parse-analysis-with-a-visitor-like-pattern/</link>
		<comments>http://ominian.com/2012/01/11/pynarcissus-parser-post-parse-analysis-with-a-visitor-like-pattern/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 04:54:18 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ominian.com/?p=180</guid>
		<description><![CDATA[Someone recently asked me how the more time involved analyzer I wrote works, unfortunately I can&#8217;t post it as its targeted for a client project&#8230; but I can post a simpler mockup of it combined with the person&#8217;s function print logic. Sure this loses the ability to step back up the chain of tokens, but <a href='http://ominian.com/2012/01/11/pynarcissus-parser-post-parse-analysis-with-a-visitor-like-pattern/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Someone recently asked me how the more time involved analyzer I wrote works, unfortunately I can&#8217;t post it as its targeted for a client project&#8230; but I can post a simpler mockup of it combined with the person&#8217;s function print logic. </p>
<p><script src="https://gist.github.com/1598830.js"> </script></p>
<p>Sure this loses the ability to step back up the chain of tokens, but for most cases like detecting functions or in my case line numbers to intrument, this construct works for me.</p>
]]></content:encoded>
			<wfw:commentRss>http://ominian.com/2012/01/11/pynarcissus-parser-post-parse-analysis-with-a-visitor-like-pattern/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Working with &amp; using pynarcissus to parse Javascript in Python</title>
		<link>http://ominian.com/2012/01/06/working-with-using-pynarcissus-to-parse-javascript-in-python/</link>
		<comments>http://ominian.com/2012/01/06/working-with-using-pynarcissus-to-parse-javascript-in-python/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 19:50:33 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ominian.com/?p=178</guid>
		<description><![CDATA[If you&#8217;re reading this, you&#8217;re either one of the 10-15 user-agents stalking my blog or one of the search engines sent you here because you&#8217;d like to analyze Javascript from inside of Python. In my cursory research phase, the best option seems to be pynarcissus. As of 2012/01/6 there has been no commits or updates <a href='http://ominian.com/2012/01/06/working-with-using-pynarcissus-to-parse-javascript-in-python/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re reading this, you&#8217;re either one of the 10-15 user-agents stalking my blog or one of the search engines sent you here because you&#8217;d like to analyze Javascript from inside of Python.  In my cursory research phase, the best option seems to be <a href="http://code.google.com/p/pynarcissus/">pynarcissus</a>.</p>
<p>As of 2012/01/6 there has been no commits or updates to the project which seemed disheartening until I gave it a try.  From my tests, pynarcissus DOES WORK.</p>
<p>Below is proof of concept code I wrote to walk through the entire token tree of a ExtJS Sencha touch file which is probably the most extreme JS compatible test I could come up with, mostly because ExtJS code reliably and utterly confuses Komodo IDE and other IDE&#8217;s I use on a daily basis.</p>
<p>The codez:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">&nbsp;
<span style="color: #ff7700;font-weight:bold;">from</span> pynarcissus <span style="color: #ff7700;font-weight:bold;">import</span> parse
<span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">collections</span> <span style="color: #ff7700;font-weight:bold;">import</span> defaultdict
&nbsp;
<span style="color: #483d8b;">&quot;&quot;&quot;
    Syntax analysis done dirty
&nbsp;
&quot;&quot;&quot;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#Linenums JSCoverage said were correct</span>
targetnums = <span style="color: black;">&#91;</span><span style="color: #ff4500;">28</span>,<span style="color: #ff4500;">44</span>,<span style="color: #ff4500;">51</span>,<span style="color: #ff4500;">53</span>,<span style="color: #ff4500;">57</span>,<span style="color: #ff4500;">59</span>,<span style="color: #ff4500;">60</span>,<span style="color: #ff4500;">68</span>,<span style="color: #ff4500;">69</span>,<span style="color: #ff4500;">70</span>,<span style="color: #ff4500;">77</span>,<span style="color: #ff4500;">78</span>,<span style="color: #ff4500;">79</span>,<span style="color: #ff4500;">86</span>,<span style="color: #ff4500;">87</span>,<span style="color: #ff4500;">88</span>,<span style="color: #ff4500;">95</span><span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#Operands/tokens unique to these lines</span>
injectionOPS = <span style="color: black;">&#123;</span><span style="color: #483d8b;">'IF'</span>,<span style="color: #483d8b;">'CALL'</span>,<span style="color: #483d8b;">'VAR'</span>,<span style="color: #483d8b;">'RETURN'</span><span style="color: black;">&#125;</span>
<span style="color: #808080; font-style: italic;">#operands/tokens that should be avoided</span>
exclusionOPS = <span style="color: black;">&#123;</span><span style="color: #483d8b;">''</span><span style="color: black;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#test file</span>
raw = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;./juggernaut/parser/test/test_original.js&quot;</span><span style="color: black;">&#41;</span>.<span style="color: black;">read</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
tokens = parse<span style="color: black;">&#40;</span>raw,<span style="color: #483d8b;">'test_original.js'</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#Master list of linenums to TOKEN types</span>
&nbsp;
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> findlines<span style="color: black;">&#40;</span>node, pr_linenums = <span style="color: #008000;">None</span>, capture_all = <span style="color: #008000;">False</span><span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">&quot;&quot;&quot;
        Walk over the hills and through the valleys and hope
        we hit every single token in the tree along the way.
    &quot;&quot;&quot;</span>
    linenums = defaultdict<span style="color: black;">&#40;</span><span style="color: #008000;">set</span><span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">if</span> pr_linenums <span style="color: #ff7700;font-weight:bold;">is</span> <span style="color: #008000;">None</span> <span style="color: #ff7700;font-weight:bold;">else</span> pr_linenums
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">if</span> node.<span style="color: #008000;">type</span> == <span style="color: #483d8b;">'IF'</span>:
        dbgp = <span style="color: #ff4500;">1</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">if</span> node.<span style="color: #008000;">type</span> <span style="color: #ff7700;font-weight:bold;">in</span> injectionOPS <span style="color: #ff7700;font-weight:bold;">or</span> capture_all:
        linenums<span style="color: black;">&#91;</span>node.<span style="color: black;">lineno</span><span style="color: black;">&#93;</span>.<span style="color: black;">add</span><span style="color: black;">&#40;</span>node.<span style="color: #008000;">type</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">for</span> sub <span style="color: #ff7700;font-weight:bold;">in</span> node:
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">len</span><span style="color: black;">&#40;</span>sub<span style="color: black;">&#41;</span> <span style="color: #66cc66;">&gt;</span> <span style="color: #ff4500;">0</span>:
            linenums = findlines<span style="color: black;">&#40;</span>sub, linenums, capture_all<span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #ff7700;font-weight:bold;">for</span> attr <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: black;">&#91;</span><span style="color: #483d8b;">'thenPart'</span>, <span style="color: #483d8b;">'elsePart'</span>, <span style="color: #483d8b;">'expression'</span>, <span style="color: #483d8b;">'body'</span> <span style="color: black;">&#93;</span>:
            child = <span style="color: #008000;">getattr</span><span style="color: black;">&#40;</span>sub, attr, <span style="color: #008000;">None</span><span style="color: black;">&#41;</span>
            <span style="color: #ff7700;font-weight:bold;">if</span> child:
                linenums = findlines<span style="color: black;">&#40;</span>child, linenums, capture_all<span style="color: black;">&#41;</span>
&nbsp;
&nbsp;
        <span style="color: #ff7700;font-weight:bold;">if</span> sub.<span style="color: #008000;">type</span> <span style="color: #ff7700;font-weight:bold;">in</span> injectionOPS <span style="color: #ff7700;font-weight:bold;">or</span> capture_all:
            linenums<span style="color: black;">&#91;</span>sub.<span style="color: black;">lineno</span><span style="color: black;">&#93;</span>.<span style="color: black;">add</span><span style="color: black;">&#40;</span>sub.<span style="color: #008000;">type</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">return</span> linenums
&nbsp;
linenums = findlines<span style="color: black;">&#40;</span>tokens, defaultdict<span style="color: black;">&#40;</span><span style="color: #008000;">set</span><span style="color: black;">&#41;</span>, <span style="color: #008000;">False</span><span style="color: black;">&#41;</span>
injectionTargets = <span style="color: #008000;">sorted</span><span style="color: black;">&#40;</span>linenums.<span style="color: black;">keys</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
source = raw.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">cStringIO</span> <span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">StringIO</span>
buffer = <span style="color: #dc143c;">StringIO</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">for</span> lineno, line <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">enumerate</span><span style="color: black;">&#40;</span>source, <span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">if</span> lineno <span style="color: #ff7700;font-weight:bold;">in</span> injectionTargets:
        <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #66cc66;">&gt;&gt;</span> buffer, <span style="color: #483d8b;">&quot;$_injectionjs['testfile'][%s] += 1;&quot;</span> <span style="color: #66cc66;">%</span> lineno
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #66cc66;">&gt;&gt;</span> buffer, line
&nbsp;
buffer.<span style="color: black;">reset</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'test_file.js'</span>,<span style="color: #483d8b;">'wb'</span><span style="color: black;">&#41;</span>.<span style="color: black;">write</span><span style="color: black;">&#40;</span>buffer.<span style="color: black;">read</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
dbgp = <span style="color: #ff4500;">1</span></pre></div></div>

<p>Briefly, the above code is a unstructured test to attempt to match what JSCoverage thinks are the correct lines to instrument and for the most part it works well.  The most crucial needed to be able to blindly traverse the token node tree is the logic inside the findlines function.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">&nbsp;
    <span style="color: #483d8b;">&quot;&quot;&quot;
         the product of pynarcissus.parse is a Node object.
         Node's inherit lists, so for some JS structures you will
         iterate over it's children.  Other times, you might not be
         so lucky, hence the inner loop to detect Node elements.
&nbsp;
         For instance, for Node.type == 'IF' the thenPart and elsePart
         properties will be populated alongside with 'expression'.
&nbsp;
         Othertimes, specially for function/method nodes, there will be a body
         attribute.
&nbsp;
        All of these attributes, if not None, are instances of pynarcissus's Node class.
&nbsp;
    &quot;&quot;&quot;</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> sub <span style="color: #ff7700;font-weight:bold;">in</span> node:
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">len</span><span style="color: black;">&#40;</span>sub<span style="color: black;">&#41;</span> <span style="color: #66cc66;">&gt;</span> <span style="color: #ff4500;">0</span>:
            linenums = findlines<span style="color: black;">&#40;</span>sub, linenums, capture_all<span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #ff7700;font-weight:bold;">for</span> attr <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: black;">&#91;</span><span style="color: #483d8b;">'thenPart'</span>, <span style="color: #483d8b;">'elsePart'</span>, <span style="color: #483d8b;">'expression'</span>, <span style="color: #483d8b;">'body'</span> <span style="color: black;">&#93;</span>:
            child = <span style="color: #008000;">getattr</span><span style="color: black;">&#40;</span>sub, attr, <span style="color: #008000;">None</span><span style="color: black;">&#41;</span>
            <span style="color: #ff7700;font-weight:bold;">if</span> child:
                linenums = findlines<span style="color: black;">&#40;</span>child, linenums, capture_all<span style="color: black;">&#41;</span>
&nbsp;
&nbsp;
        <span style="color: #ff7700;font-weight:bold;">if</span> sub.<span style="color: #008000;">type</span> <span style="color: #ff7700;font-weight:bold;">in</span> injectionOPS <span style="color: #ff7700;font-weight:bold;">or</span> capture_all:
            linenums<span style="color: black;">&#91;</span>sub.<span style="color: black;">lineno</span><span style="color: black;">&#93;</span>.<span style="color: black;">add</span><span style="color: black;">&#40;</span>sub.<span style="color: #008000;">type</span><span style="color: black;">&#41;</span></pre></div></div>

<p>As you can see, there&#8217;s a linenums variable being passed around like the village bicycle, here is what it looks like.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #dc143c;">pprint</span>.<span style="color: #dc143c;">pprint</span><span style="color: black;">&#40;</span>linenums.<span style="color: black;">items</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
<span style="color: black;">&#91;</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'SCRIPT'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">28</span>,
  <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'CALL'</span>,
       <span style="color: #483d8b;">'DOT'</span>,
       <span style="color: #483d8b;">'IDENTIFIER'</span>,
       <span style="color: #483d8b;">'LIST'</span>,
       <span style="color: #483d8b;">'OBJECT_INIT'</span>,
       <span style="color: #483d8b;">'SEMICOLON'</span>,
       <span style="color: #483d8b;">'STRING'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">29</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'IDENTIFIER'</span>, <span style="color: #483d8b;">'PROPERTY_INIT'</span>, <span style="color: #483d8b;">'STRING'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">30</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'ARRAY_INIT'</span>, <span style="color: #483d8b;">'IDENTIFIER'</span>, <span style="color: #483d8b;">'PROPERTY_INIT'</span>, <span style="color: #483d8b;">'STRING'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">31</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'IDENTIFIER'</span>, <span style="color: #483d8b;">'OBJECT_INIT'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">32</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'IDENTIFIER'</span>, <span style="color: #483d8b;">'NULL'</span>, <span style="color: #483d8b;">'PROPERTY_INIT'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">33</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'PROPERTY_INIT'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">34</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'IDENTIFIER'</span>, <span style="color: #483d8b;">'OBJECT_INIT'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">35</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'IDENTIFIER'</span>, <span style="color: #483d8b;">'PROPERTY_INIT'</span>, <span style="color: #483d8b;">'STRING'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">36</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'FALSE'</span>, <span style="color: #483d8b;">'IDENTIFIER'</span>, <span style="color: #483d8b;">'PROPERTY_INIT'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">37</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'IDENTIFIER'</span>, <span style="color: #483d8b;">'PROPERTY_INIT'</span>, <span style="color: #483d8b;">'TRUE'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">38</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'IDENTIFIER'</span>, <span style="color: #483d8b;">'PROPERTY_INIT'</span>, <span style="color: #483d8b;">'STRING'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">39</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'IDENTIFIER'</span>, <span style="color: #483d8b;">'PROPERTY_INIT'</span>, <span style="color: #483d8b;">'TRUE'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">40</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'IDENTIFIER'</span>, <span style="color: #483d8b;">'PROPERTY_INIT'</span>, <span style="color: #483d8b;">'STRING'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">41</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'PROPERTY_INIT'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">43</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'FUNCTION'</span>, <span style="color: #483d8b;">'IDENTIFIER'</span>, <span style="color: #483d8b;">'SCRIPT'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">44</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'BLOCK'</span>, <span style="color: #483d8b;">'IF'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">45</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'CALL'</span>, <span style="color: #483d8b;">'DOT'</span>, <span style="color: #483d8b;">'IDENTIFIER'</span>, <span style="color: #483d8b;">'LIST'</span>, <span style="color: #483d8b;">'SEMICOLON'</span>, <span style="color: #483d8b;">'STRING'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">46</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'IF'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">52</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'PROPERTY_INIT'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">57</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'FUNCTION'</span>, <span style="color: #483d8b;">'IDENTIFIER'</span>, <span style="color: #483d8b;">'SCRIPT'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">58</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'IDENTIFIER'</span>, <span style="color: #483d8b;">'VAR'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">60</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'IDENTIFIER'</span>, <span style="color: #483d8b;">'VAR'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">64</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'CALL'</span>, <span style="color: #483d8b;">'DOT'</span>, <span style="color: #483d8b;">'IDENTIFIER'</span>, <span style="color: #483d8b;">'LIST'</span>, <span style="color: #483d8b;">'SEMICOLON'</span>, <span style="color: #483d8b;">'THIS'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">66</span>,
  <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'CALL'</span>, <span style="color: #483d8b;">'DOT'</span>, <span style="color: #483d8b;">'IDENTIFIER'</span>, <span style="color: #483d8b;">'LIST'</span>, <span style="color: #483d8b;">'SEMICOLON'</span>, <span style="color: #483d8b;">'STRING'</span>, <span style="color: #483d8b;">'THIS'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">67</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'RETURN'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">68</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'PROPERTY_INIT'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">74</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'FUNCTION'</span>, <span style="color: #483d8b;">'IDENTIFIER'</span>, <span style="color: #483d8b;">'SCRIPT'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">75</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'IDENTIFIER'</span>, <span style="color: #483d8b;">'VAR'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">76</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'IDENTIFIER'</span>, <span style="color: #483d8b;">'VAR'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">77</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'RETURN'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">78</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'PROPERTY_INIT'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">83</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'FUNCTION'</span>, <span style="color: #483d8b;">'IDENTIFIER'</span>, <span style="color: #483d8b;">'SCRIPT'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">84</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'IDENTIFIER'</span>, <span style="color: #483d8b;">'VAR'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">85</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'IDENTIFIER'</span>, <span style="color: #483d8b;">'VAR'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">86</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'CALL'</span>, <span style="color: #483d8b;">'DOT'</span>, <span style="color: #483d8b;">'IDENTIFIER'</span>, <span style="color: #483d8b;">'LIST'</span>, <span style="color: #483d8b;">'SEMICOLON'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">87</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'PROPERTY_INIT'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">92</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'FUNCTION'</span>, <span style="color: #483d8b;">'IDENTIFIER'</span>, <span style="color: #483d8b;">'SCRIPT'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">93</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'IDENTIFIER'</span>, <span style="color: #483d8b;">'VAR'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">94</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'IDENTIFIER'</span>, <span style="color: #483d8b;">'VAR'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">95</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'CALL'</span>, <span style="color: #483d8b;">'DOT'</span>, <span style="color: #483d8b;">'IDENTIFIER'</span>, <span style="color: #483d8b;">'LIST'</span>, <span style="color: #483d8b;">'SEMICOLON'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">96</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'PROPERTY_INIT'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">101</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'FUNCTION'</span>, <span style="color: #483d8b;">'IDENTIFIER'</span>, <span style="color: #483d8b;">'SCRIPT'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">102</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'CALL'</span>, <span style="color: #483d8b;">'DOT'</span>, <span style="color: #483d8b;">'IDENTIFIER'</span>, <span style="color: #483d8b;">'LIST'</span>, <span style="color: #483d8b;">'SEMICOLON'</span>, <span style="color: #483d8b;">'STRING'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
 <span style="color: black;">&#40;</span><span style="color: #ff4500;">103</span>, <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'PROPERTY_INIT'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#93;</span></pre></div></div>

<p>This is enough information for me to be able to safely determine injection points for an instrumentation line.   I am still working through some problems with this whole mess, specifically line 46 looks like:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">       <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
$_injectionjs<span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'testfile'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">45</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">+=</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
            console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;REDACTED&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$_injectionjs<span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'testfile'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">46</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">+=</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">2</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">3</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;boop&quot;</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;">else</span><span style="color: #009900;">&#123;</span>
            console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;bleep&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span></pre></div></div>

<p>after being instrumented.  As you can see, I am skipping over the else if chain&#8230; which leads me to believe I am missing YET ANOTHER dynamically assigned Node property.</p>
]]></content:encoded>
			<wfw:commentRss>http://ominian.com/2012/01/06/working-with-using-pynarcissus-to-parse-javascript-in-python/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

