<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>A River of Words - Tools and Languages</title>
    <link>http://blog.joeysmith.com/</link>
    <description>Drowning In Stupid</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.4.1 - http://www.s9y.org/</generator>
    <pubDate>Tue, 04 Nov 2008 20:19:11 GMT</pubDate>

    <image>
        <url>http://blog.joeysmith.com/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: A River of Words - Tools and Languages - Drowning In Stupid</title>
        <link>http://blog.joeysmith.com/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Bob Ippolito on JSON Hijacking</title>
    <link>http://blog.joeysmith.com/46.html</link>
            <category>JavaScript</category>
    
    <comments>http://blog.joeysmith.com/46.html#comments</comments>
    <wfw:comment>http://blog.joeysmith.com/wfwcomment.php?cid=46</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.joeysmith.com/rss.php?version=2.0&amp;type=comments&amp;cid=46</wfw:commentRss>
    

    <author>nospam@example.com (TML)</author>
    <content:encoded>
    	&lt;p&gt;The always brilliant author of the &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/bob.pythonmac.org/&#039;);&quot;  href=&quot;http://bob.pythonmac.org/&quot;&gt;`from &lt;i&gt;future&lt;/i&gt; import *` blog&lt;/a&gt; brings us an &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/bob.pythonmac.org/archives/2007/04/05/fortify-javascript-hijacking-fud/&#039;);&quot;  href=&quot;http://bob.pythonmac.org/archives/2007/04/05/fortify-javascript-hijacking-fud/&quot;&gt;article&lt;/a&gt; discussing a potential &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.fortifysoftware.com/servlet/downloads/public/JavaScript_Hijacking.pdf&#039;);&quot;  href=&quot;http://www.fortifysoftware.com/servlet/downloads/public/JavaScript_Hijacking.pdf&quot;&gt;JavaScript Hijacking&lt;/a&gt; [pdf] scenario &amp;#8211; the simple answer is &amp;#8220;Don&amp;#8217;t send &lt;span class=&quot;caps&quot;&gt;JSON&lt;/span&gt; data as a list, send it as an object instead&amp;#8221;. That is, if you wanted to send:&lt;/p&gt;

&lt;pre style=&quot;font-size:9pt;&quot;&gt;
&lt;span style=&quot;color:#000000&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#bd8d8b&quot;&gt;&amp;quot;foo&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color:#bd8d8b&quot;&gt;&amp;quot;bar&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;]&lt;/span&gt;
&lt;/pre&gt;

	&lt;p&gt;you can avoid the security hole by sending something like this instead:&lt;/p&gt;

&lt;pre style=&quot;font-size:9pt;&quot;&gt;
&lt;span style=&quot;color:#000000&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#bd8d8b&quot;&gt;&amp;quot;data&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;: [&lt;/span&gt;&lt;span style=&quot;color:#bd8d8b&quot;&gt;&amp;quot;foo&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color:#bd8d8b&quot;&gt;&amp;quot;bar&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;]}&lt;/span&gt;
&lt;/pre&gt;

	&lt;p&gt;and then stripping the object on the other end.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Tue, 04 Nov 2008 13:14:00 -0700</pubDate>
    <guid isPermaLink="false">http://blog.joeysmith.com/46.html</guid>
    
</item>
<item>
    <title>Stupid JavaScript Tricks: Make Page Editable</title>
    <link>http://blog.joeysmith.com/37.html</link>
            <category>JavaScript</category>
    
    <comments>http://blog.joeysmith.com/37.html#comments</comments>
    <wfw:comment>http://blog.joeysmith.com/wfwcomment.php?cid=37</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://blog.joeysmith.com/rss.php?version=2.0&amp;type=comments&amp;cid=37</wfw:commentRss>
    

    <author>nospam@example.com (TML)</author>
    <content:encoded>
    	&lt;p&gt;Drag this &lt;a href=&quot;javascript:document.body.contentEditable=&#039;true&#039;;%20document.designMode=&#039;on&#039;;%20void%200&quot;&gt;Make Page Editable&lt;/a&gt; link to your &amp;#8220;Bookmarks Toolbar&amp;#8221; in recent versions of Firefox, and click on it to enable the built-in &amp;#8220;Page Composer&amp;#8221;, allowing you to edit any page you want! &lt;img src=&quot;http://blog.joeysmith.com/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;/p&gt; 
    </content:encoded>

    <pubDate>Thu, 16 Oct 2008 15:17:45 -0600</pubDate>
    <guid isPermaLink="false">http://blog.joeysmith.com/37.html</guid>
    
</item>
<item>
    <title>Project Euler, Problem #2 in Python</title>
    <link>http://blog.joeysmith.com/35.html</link>
            <category>Python</category>
    
    <comments>http://blog.joeysmith.com/35.html#comments</comments>
    <wfw:comment>http://blog.joeysmith.com/wfwcomment.php?cid=35</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.joeysmith.com/rss.php?version=2.0&amp;type=comments&amp;cid=35</wfw:commentRss>
    

    <author>nospam@example.com (TML)</author>
    <content:encoded>
    	&lt;p&gt;As a &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/codekata.pragprog.com/&#039;);&quot;  href=&quot;http://codekata.pragprog.com/&quot;&gt;Code Kata&lt;/a&gt;, I&amp;#8217;ve been working my way through the &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/projecteuler.net/index.php?section=problems&#039;);&quot;  href=&quot;http://projecteuler.net/index.php?section=problems&quot;&gt;Project Euler&lt;/a&gt; stuff.&lt;/p&gt;

	&lt;p&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/projecteuler.net/index.php?section=problems&amp;amp;#38;id=2&#039;);&quot;  href=&quot;http://projecteuler.net/index.php?section=problems&amp;#38;id=2&quot;&gt;Here&amp;#8217;s&lt;/a&gt; the problem.&lt;/p&gt;

	&lt;p&gt;Here&amp;#8217;s my solution:&lt;/p&gt;

	&lt;p&gt;&lt;pre style=&quot;font-size:9pt;&quot;&gt;&lt;/p&gt;

	&lt;p&gt;&lt;span style=&quot;color:#ac2020; font-style:italic&quot;&gt;# A generator to derive the Fibonacci sequence&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color:#9c20ee; font-weight:bold&quot;&gt;def&lt;/span&gt; &lt;span style=&quot;color:#000000&quot;&gt;fib&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;():&lt;/span&gt;
    x&lt;span style=&quot;color:#000000&quot;&gt;,&lt;/span&gt; y &lt;span style=&quot;color:#000000&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color:#000000&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color:#000000&quot;&gt;1&lt;/span&gt;
    &lt;span style=&quot;color:#9c20ee; font-weight:bold&quot;&gt;yield&lt;/span&gt; x
    &lt;span style=&quot;color:#9c20ee; font-weight:bold&quot;&gt;yield&lt;/span&gt; y
    &lt;span style=&quot;color:#9c20ee; font-weight:bold&quot;&gt;while&lt;/span&gt; &lt;span style=&quot;color:#000000&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;:&lt;/span&gt;
        x&lt;span style=&quot;color:#000000&quot;&gt;,&lt;/span&gt; y &lt;span style=&quot;color:#000000&quot;&gt;=&lt;/span&gt; y&lt;span style=&quot;color:#000000&quot;&gt;,&lt;/span&gt; x&lt;span style=&quot;color:#000000&quot;&gt;+&lt;/span&gt;y
        &lt;span style=&quot;color:#9c20ee; font-weight:bold&quot;&gt;yield&lt;/span&gt; y&lt;/p&gt;

	&lt;p&gt;&lt;span style=&quot;color:#9c20ee; font-weight:bold&quot;&gt;if&lt;/span&gt; &lt;i&gt;name&lt;/i&gt; &lt;span style=&quot;color:#000000&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color:#bd8d8b&quot;&gt;&amp;#8216;&lt;i&gt;main&lt;/i&gt;&amp;#8216;&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;:&lt;/span&gt;
    idx &lt;span style=&quot;color:#000000&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color:#000000&quot;&gt;0&lt;/span&gt;
    &lt;span style=&quot;color:#208920&quot;&gt;sum&lt;/span&gt; &lt;span style=&quot;color:#000000&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color:#000000&quot;&gt;0&lt;/span&gt;
    gen &lt;span style=&quot;color:#000000&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color:#000000&quot;&gt;fib&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;()&lt;/span&gt;&lt;/p&gt;

    &lt;span style=&quot;color:#9c20ee; font-weight:bold&quot;&gt;while&lt;/span&gt; idx &lt;span style=&quot;color:#000000&quot;&gt;&amp;lt;=&lt;/span&gt; &lt;span style=&quot;color:#000000&quot;&gt;4000000&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;:&lt;/span&gt;
        idx &lt;span style=&quot;color:#000000&quot;&gt;=&lt;/span&gt; gen&lt;span style=&quot;color:#000000&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;next&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;()&lt;/span&gt;
        &lt;span style=&quot;color:#9c20ee; font-weight:bold&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color:#000000&quot;&gt;(&lt;/span&gt;g &lt;span style=&quot;color:#000000&quot;&gt;%&lt;/span&gt; &lt;span style=&quot;color:#000000&quot;&gt;2&lt;/span&gt; &lt;span style=&quot;color:#000000&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color:#000000&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;):&lt;/span&gt; h &lt;span style=&quot;color:#000000&quot;&gt;=&lt;/span&gt; h&lt;span style=&quot;color:#000000&quot;&gt;+&lt;/span&gt;g
    &lt;span style=&quot;color:#9c20ee; font-weight:bold&quot;&gt;print&lt;/span&gt; h
&lt;/pre&gt;

	&lt;p&gt;Note: You want to be careful how you use infinite generators like the &amp;#8216;fib()&amp;#8217; I created above.&lt;/p&gt;

	&lt;p&gt;One guy on the forums noted:&lt;/p&gt;

	&lt;blockquote&gt;
		&lt;p&gt;Now, replacing an odd number with O and an even with E, we get: O, O, E, O, O, E, O, O, E, O, O, E, O, O, E&amp;#8230;And so each third number is even. We don&amp;#8217;t need to calculate the odd numbers. Starting from an two odd terms x, y, the series is: x, y, x + y, x + 2y, 2x + 3y, 3x + 5y&lt;/p&gt;
	&lt;/blockquote&gt; 
    </content:encoded>

    <pubDate>Tue, 14 Oct 2008 02:10:00 -0600</pubDate>
    <guid isPermaLink="false">http://blog.joeysmith.com/35.html</guid>
    
</item>
<item>
    <title>Pylons References</title>
    <link>http://blog.joeysmith.com/19.html</link>
            <category>Python</category>
    
    <comments>http://blog.joeysmith.com/19.html#comments</comments>
    <wfw:comment>http://blog.joeysmith.com/wfwcomment.php?cid=19</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.joeysmith.com/rss.php?version=2.0&amp;type=comments&amp;cid=19</wfw:commentRss>
    

    <author>nospam@example.com (TML)</author>
    <content:encoded>
    	&lt;p&gt;Spent the day poking at &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/pylonshq.com/&#039;);&quot;  href=&quot;http://pylonshq.com/&quot;&gt;Pylons 0.9.7rc2&lt;/a&gt; as well as the new documentation site that came out with the release of &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/python.org/download/releases/2.6/&#039;);&quot;  href=&quot;http://python.org/download/releases/2.6/&quot;&gt;Python 2.6&lt;/a&gt; &amp;#8211; some sweet stuff in there.&lt;/p&gt;

	&lt;p&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/pythonpaste.org/webob/&#039;);&quot;  href=&quot;http://pythonpaste.org/webob/&quot;&gt;WebOb: The New Middleware Layer on 0.9.7&lt;/a&gt;, its &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/pythonpaste.org/webob/reference.html&#039;);&quot;  href=&quot;http://pythonpaste.org/webob/reference.html&quot;&gt;Reference page&lt;/a&gt;, &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/pythonpaste.org/webob/differences.html&#039;);&quot;  href=&quot;http://pythonpaste.org/webob/differences.html&quot;&gt;How WebOb is different&lt;/a&gt; and &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/blog.ianbicking.org/2007/08/18/webob/&#039;);&quot;  href=&quot;http://blog.ianbicking.org/2007/08/18/webob/&quot;&gt;Ian Bicking&amp;#8217;s Blog Post about it&lt;/a&gt; &amp;#8211; &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/blog.ianbicking.org&#039;);&quot;  href=&quot;http://blog.ianbicking.org&quot;&gt;Ian&lt;/a&gt; is one of those guys who is so smart it fills me with a jealous rage. I&amp;#8217;ve already found a lot of useful stuff in WebOb that was missing or hard to do with the older Pylons middleware.&lt;/p&gt;

	&lt;p&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/wiki.pylonshq.com/dashboard.action&#039;);&quot;  href=&quot;http://wiki.pylonshq.com/dashboard.action&quot;&gt;Base Pylons Documentation&lt;/a&gt;, &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/wiki.pylonshq.com/display/authkitcookbook/Home&#039;);&quot;  href=&quot;http://wiki.pylonshq.com/display/authkitcookbook/Home&quot;&gt;AuthKit Cookbook&lt;/a&gt;, &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/wiki.pylonshq.com/display/pylonscommunity/Pylons+Roadmap+to+1.0&#039;);&quot;  href=&quot;http://wiki.pylonshq.com/display/pylonscommunity/Pylons+Roadmap+to+1.0&quot;&gt;Roadmap to Pylons 1.0&lt;/a&gt; &amp;#8211; just some good links to pylonshq&lt;/p&gt;

	&lt;p&gt;Python modules I need to brush up on, or just links I used in the course of today&amp;#8217;s work: &lt;br /&gt;
&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/docs.python.org/modindex.html&#039;);&quot;  href=&quot;http://docs.python.org/modindex.html&quot;&gt;2.6 Documentation Index&lt;/a&gt;, &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/docs.python.org/library/shutil.html&#039;);&quot;  href=&quot;http://docs.python.org/library/shutil.html&quot;&gt;shutil&lt;/a&gt;, &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/docs.python.org/library/xdrlib.html&#039;);&quot;  href=&quot;http://docs.python.org/library/xdrlib.html&quot;&gt;xdrlib&lt;/a&gt;, &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/docs.python.org/library/functools.html&#039;);&quot;  href=&quot;http://docs.python.org/library/functools.html&quot;&gt;functools &amp;#8211; a lot of functional paradigm stuff moved here?&lt;/a&gt;, &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/docs.python.org/library/stringio.html&#039;);&quot;  href=&quot;http://docs.python.org/library/stringio.html&quot;&gt;StringIO&lt;/a&gt;, &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/docs.python.org/library/tempfile.html&#039;);&quot;  href=&quot;http://docs.python.org/library/tempfile.html&quot;&gt;tempfile &amp;#8211; probably the best tempfile implementation by a programming language, ever&lt;/a&gt;, &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/simplejson.googlecode.com/svn/tags/simplejson-2.0.1/docs/index.html&#039;);&quot;  href=&quot;http://simplejson.googlecode.com/svn/tags/simplejson-2.0.1/docs/index.html&quot;&gt;simpleJSON revved to 2.0.1&lt;/a&gt;, &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/docs.python.org/library/index.html&#039;);&quot;  href=&quot;http://docs.python.org/library/index.html&quot;&gt;2.6 &amp;#8216;Standard Library&amp;#8217; Index&lt;/a&gt;&lt;/p&gt;

	&lt;p&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.makotemplates.org/docs/&#039;);&quot;  href=&quot;http://www.makotemplates.org/docs/&quot;&gt;Mako&lt;/a&gt; &amp;#8211; I&amp;#8217;m not sure why there are so dang many Pythons template layers. In fact, &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.reportlab.org/preppy.html&#039;);&quot;  href=&quot;http://www.reportlab.org/preppy.html&quot;&gt;Preppy&lt;/a&gt; is another one that I might use more in the future due to its integration with &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.reportlab.org/&#039;);&quot;  href=&quot;http://www.reportlab.org/&quot;&gt;ReportLab&amp;#8217;s &lt;span class=&quot;caps&quot;&gt;PDF&lt;/span&gt; Toolkit&lt;/a&gt;&lt;/p&gt;

	&lt;p&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/pylonsbook.com/alpha1/logging&#039;);&quot;  href=&quot;http://pylonsbook.com/alpha1/logging&quot;&gt;The Pylons Book&lt;/a&gt; &amp;#8211; I&amp;#8217;ve already pre-purchased, but wish it had more &amp;#8220;nuts and bolts&amp;#8221; based on what I&amp;#8217;ve seen so far.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Thu, 02 Oct 2008 15:02:05 -0600</pubDate>
    <guid isPermaLink="false">http://blog.joeysmith.com/19.html</guid>
    
</item>
<item>
    <title>Return from hiatus, and a quick jQuery example</title>
    <link>http://blog.joeysmith.com/16.html</link>
            <category>JavaScript</category>
    
    <comments>http://blog.joeysmith.com/16.html#comments</comments>
    <wfw:comment>http://blog.joeysmith.com/wfwcomment.php?cid=16</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.joeysmith.com/rss.php?version=2.0&amp;type=comments&amp;cid=16</wfw:commentRss>
    

    <author>nospam@example.com (TML)</author>
    <content:encoded>
    	&lt;p&gt;Sorry for the break &amp;#8211; I spent the past week or so frantically preparing for, and then attending, my Director&amp;#8217;s annual off-site planning meeting. As always, it was a valuable experience &amp;#8211; the opportunity to interact with Managers in a more relaxed setting, and to see how each of us attacks a given problem from so many different angles, is incredibly cool. Plus, I got to play golf again. &lt;img src=&quot;http://blog.joeysmith.com/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;/p&gt;

	&lt;p&gt;Today I&amp;#8217;m bringing you a &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/joeysmith.com/~joey/jqtest.html&#039;);&quot;  href=&quot;http://joeysmith.com/~joey/jqtest.html&quot;&gt;quick example&lt;/a&gt; of how to use &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/jquery.com/&#039;);&quot;  href=&quot;http://jquery.com/&quot;&gt;jQuery&lt;/a&gt; to check with a &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/joeysmith.com/~joey/jqtest.php?debug=1&#039;);&quot;  href=&quot;http://joeysmith.com/~joey/jqtest.php?debug=1&quot;&gt;Service&lt;/a&gt; to see whether the user should be allowed to toggle the state of a given checkbox. In my example, the &amp;#8220;Service&amp;#8221; only allows you to check boxes labelled with a prime number. I&amp;#8217;m sure there&amp;#8217;s a more jQuery-approved method, but this one was simpler to figure out than &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/docs.jquery.com/Attributes/val#val&#039;);&quot;  href=&quot;http://docs.jquery.com/Attributes/val#val&quot;&gt;.val()&lt;/a&gt; &amp;#8211; I couldn&amp;#8217;t figure out how to make that *un*check a box.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Thu, 21 Aug 2008 22:37:10 -0600</pubDate>
    <guid isPermaLink="false">http://blog.joeysmith.com/16.html</guid>
    
</item>
<item>
    <title>XMLReader punts on clone</title>
    <link>http://blog.joeysmith.com/8.html</link>
            <category>PHP</category>
    
    <comments>http://blog.joeysmith.com/8.html#comments</comments>
    <wfw:comment>http://blog.joeysmith.com/wfwcomment.php?cid=8</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.joeysmith.com/rss.php?version=2.0&amp;type=comments&amp;cid=8</wfw:commentRss>
    

    <author>nospam@example.com (TML)</author>
    <content:encoded>
    	&lt;p&gt;PHP5&amp;#8217;s &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/php.net/xmlreader&#039;);&quot;  href=&quot;http://php.net/xmlreader&quot;&gt;XMLReader&lt;/a&gt; &amp;#8211; which I used for my &lt;a href=&quot;http://blog.joeysmith.com/5.html&quot;&gt;JSON-Like XML&lt;/a&gt; post, doesn&amp;#8217;t implement a &amp;#8216;clone&amp;#8217; handler, which came as quite a shock when I attempted to implement a wrapper class that would allow me to push values back into the stream when I had to read-ahead to implement &amp;#8216;nested data structures&amp;#8217; as suggested by Davey. I had a hard time finding a good example of how to internally implement clone (even &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/safari.oreilly.com/067232704X&#039;);&quot;  href=&quot;http://safari.oreilly.com/067232704X&quot;&gt;Sara Golemon&amp;#8217;s book&lt;/a&gt; only gives it a brief mention&lt;sup class=&quot;footnote&quot;&gt;&lt;a href=&quot;#fn3680481484b994ffbcc7a9&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;), but I finally &lt;a href=&quot;http://blog.joeysmith.com/pages/clone.html&quot;&gt;came up with something&lt;/a&gt; &amp;#8211; I&amp;#8217;m building it now to see how well it works, or even if it works at all.&lt;/p&gt;

	&lt;p id=&quot;fn3680481484b994ffbcc7a9&quot; class=&quot;footnote&quot;&gt;&lt;sup&gt;1&lt;/sup&gt; zend_object_value clone_obj(zval *object TSRMLS_DC) &amp;#8211; Used to generate a new object copied from an already instantiated one. The default behavior is to create a new object instance, associate the original&amp;#8217;s handler table with it, copy the properties table and, if the class entry for the object in question defines a __clone() method, call that to allow the new object to perform additional duplication work.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Tue, 12 Aug 2008 23:12:32 -0600</pubDate>
    <guid isPermaLink="false">http://blog.joeysmith.com/8.html</guid>
    
</item>
<item>
    <title>JSON-like XML</title>
    <link>http://blog.joeysmith.com/5.html</link>
            <category>PHP</category>
    
    <comments>http://blog.joeysmith.com/5.html#comments</comments>
    <wfw:comment>http://blog.joeysmith.com/wfwcomment.php?cid=5</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://blog.joeysmith.com/rss.php?version=2.0&amp;type=comments&amp;cid=5</wfw:commentRss>
    

    <author>nospam@example.com (TML)</author>
    <content:encoded>
    	&lt;p&gt;#phpc on Freenode had a discussion tonight about how there&amp;#8217;s nothing in &lt;span class=&quot;caps&quot;&gt;XML&lt;/span&gt; that&amp;#8217;s quite as simple as &lt;span class=&quot;caps&quot;&gt;JSON&lt;/span&gt; for encoding types. I came up with this off-the-cuff &amp;#8211; as opposed to &lt;span class=&quot;caps&quot;&gt;WDDX&lt;/span&gt;, this is more JSON-like in that each &amp;#8216;&lt;span class=&quot;caps&quot;&gt;XML&lt;/span&gt; Document&amp;#8217; encodes only a single value &amp;#8211; but that value might be mapped to any of the built-in types.&lt;br /&gt;
Of course, the &amp;lt;object&gt; stuff would only work with pretty simple objects &amp;#8211; but the fact that it tries at all to instance a class is a step beyond what &lt;span class=&quot;caps&quot;&gt;JSON&lt;/span&gt; does, which is &lt;span class=&quot;caps&quot;&gt;ALWAYS&lt;/span&gt; an instance of stdClass. You could drop this extra &amp;#8216;feature&amp;#8217; by &lt;del&gt;remove&lt;/del&gt; removing line 43 ($class = ...) and changing line 44 to:&lt;br /&gt;
&lt;pre style=&quot;font-size:9pt;&quot;&gt;&lt;span style=&quot;color:#0000ff&quot;&gt;$data&lt;/span&gt; &lt;span style=&quot;color:#000000&quot;&gt;=&lt;/span&gt; new stdClass&lt;span style=&quot;color:#000000&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;/pre&gt;&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://blog.joeysmith.com/5.html#extended&quot;&gt;Continue reading &quot;JSON-like XML&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Sun, 10 Aug 2008 22:01:40 -0600</pubDate>
    <guid isPermaLink="false">http://blog.joeysmith.com/5.html</guid>
    
</item>
<item>
    <title>Refinement of ringBuffer</title>
    <link>http://blog.joeysmith.com/4.html</link>
            <category>PHP</category>
    
    <comments>http://blog.joeysmith.com/4.html#comments</comments>
    <wfw:comment>http://blog.joeysmith.com/wfwcomment.php?cid=4</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.joeysmith.com/rss.php?version=2.0&amp;type=comments&amp;cid=4</wfw:commentRss>
    

    <author>nospam@example.com (TML)</author>
    <content:encoded>
    	&lt;p&gt;&lt;pre style=&quot;font-size:9pt;&quot;&gt;    public &lt;span style=&quot;color:#9c20ee; font-weight:bold&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color:#000000&quot;&gt;offsetSet&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#0000ff&quot;&gt;$key&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color:#0000ff&quot;&gt;$value&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;) {&lt;/span&gt;
        &lt;span style=&quot;color:#9c20ee; font-weight:bold&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color:#000000&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#0000ff&quot;&gt;$key&lt;/span&gt; &lt;span style=&quot;color:#000000&quot;&gt;===&lt;/span&gt; NULL&lt;span style=&quot;color:#000000&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color:#9c20ee; font-weight:bold&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color:#0000ff&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#0000ff&quot;&gt;$value&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;);&lt;/span&gt;
        &lt;span style=&quot;color:#0000ff&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;throwEx&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#9c20ee; font-weight:bold&quot;&gt;array&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#bd8d8b&quot;&gt;&amp;#8216;Do not directly set indices in a %s, use push() instead&amp;#8217;&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;,&lt;/span&gt; &lt;i&gt;CLASS&lt;/i&gt;&lt;span style=&quot;color:#000000&quot;&gt;));&lt;/span&gt;
        &lt;span style=&quot;color:#9c20ee; font-weight:bold&quot;&gt;return&lt;/span&gt; false&lt;span style=&quot;color:#000000&quot;&gt;;&lt;/span&gt;
    &lt;span style=&quot;color:#000000&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;/pre&gt; This allows the use of PHP&amp;#8217;s &amp;#8216;push&amp;#8217; syntax: $foo[] = &amp;#8216;bar&amp;#8217;;&lt;br /&gt;
Full class after the jump.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://blog.joeysmith.com/4.html#extended&quot;&gt;Continue reading &quot;Refinement of ringBuffer&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Sat, 09 Aug 2008 14:38:32 -0600</pubDate>
    <guid isPermaLink="false">http://blog.joeysmith.com/4.html</guid>
    
</item>
<item>
    <title>Using SPL to implement a ringBuffer</title>
    <link>http://blog.joeysmith.com/3.html</link>
            <category>PHP</category>
    
    <comments>http://blog.joeysmith.com/3.html#comments</comments>
    <wfw:comment>http://blog.joeysmith.com/wfwcomment.php?cid=3</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.joeysmith.com/rss.php?version=2.0&amp;type=comments&amp;cid=3</wfw:commentRss>
    

    <author>nospam@example.com (TML)</author>
    <content:encoded>
    	&lt;p&gt;I liked the &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/php.net/spl&#039;);&quot;  href=&quot;http://php.net/spl&quot;&gt;SPL&lt;/a&gt; I used in my last post, so I cracked open my &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/oreilly.com/catalog/9780596001674/&#039;);&quot;  href=&quot;http://oreilly.com/catalog/9780596001674/&quot;&gt;Python Cookbook&lt;/a&gt; to a random location and decided to try and implement whatever it landed on in &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; using &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/php.net/spl&#039;);&quot;  href=&quot;http://php.net/spl&quot;&gt;SPL&lt;/a&gt; &amp;#8211; that led to the following implementation of a &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/en.wikipedia.org/wiki/Circular_buffer&#039;);&quot;  href=&quot;http://en.wikipedia.org/wiki/Circular_buffer&quot; target=&quot;_blank&quot;&gt;ring buffer&lt;/a&gt;.&lt;br /&gt;
There certain may be better ways to do it, but this was my first pass, and I think it behaves much how you&amp;#8217;d expect a &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/en.wikipedia.org/wiki/Circular_buffer&#039;);&quot;  href=&quot;http://en.wikipedia.org/wiki/Circular_buffer&quot; target=&quot;_blank&quot;&gt;ring buffer&lt;/a&gt; to.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://blog.joeysmith.com/3.html#extended&quot;&gt;Continue reading &quot;Using SPL to implement a ringBuffer&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Fri, 08 Aug 2008 15:39:18 -0600</pubDate>
    <guid isPermaLink="false">http://blog.joeysmith.com/3.html</guid>
    
</item>
<item>
    <title>Case-insensitive Array access in PHP</title>
    <link>http://blog.joeysmith.com/2.html</link>
            <category>PHP</category>
    
    <comments>http://blog.joeysmith.com/2.html#comments</comments>
    <wfw:comment>http://blog.joeysmith.com/wfwcomment.php?cid=2</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://blog.joeysmith.com/rss.php?version=2.0&amp;type=comments&amp;cid=2</wfw:commentRss>
    

    <author>nospam@example.com (TML)</author>
    <content:encoded>
    	&lt;p&gt;Someone in ##&lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; was looking for an array that had &amp;#8216;case-insensitive&amp;#8217; keys, so I threw this together using &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/php.net/spl/&#039;);&quot;  href=&quot;http://php.net/spl/&quot;&gt;SPL&lt;/a&gt; &lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://blog.joeysmith.com/2.html#extended&quot;&gt;Continue reading &quot;Case-insensitive Array access in PHP&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Thu, 07 Aug 2008 21:21:48 -0600</pubDate>
    <guid isPermaLink="false">http://blog.joeysmith.com/2.html</guid>
    
</item>

</channel>
</rss>