<?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>spacebeast &#187; Programming</title>
	<atom:link href="http://spacebeast.com/blog/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://spacebeast.com/blog</link>
	<description>By, for and about beasts from space</description>
	<lastBuildDate>Thu, 20 May 2010 20:27:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=389</generator>
		<item>
		<title>Programming is Fun Again with Processing</title>
		<link>http://spacebeast.com/blog/2009/01/01/programming-is-fun-again-with-processing/</link>
		<comments>http://spacebeast.com/blog/2009/01/01/programming-is-fun-again-with-processing/#comments</comments>
		<pubDate>Thu, 01 Jan 2009 22:14:08 +0000</pubDate>
		<dc:creator>Barry</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[processing]]></category>
		<category><![CDATA[processing.org]]></category>

		<guid isPermaLink="false">http://spacebeast.com/blog/?p=93</guid>
		<description><![CDATA[Have you heard about Processing? I was introduced to it indirectly through the Arduino microcontroller board I picked up a few months ago, which uses a variant of Processing for its development environment. Processing is essentially a Java-like language oriented primarily toward programming in a visual context: i.e. making graphics. It might also be the [...]]]></description>
			<content:encoded><![CDATA[<p>Have you heard about <a href="http://processing.org/">Processing</a>?  I was introduced to it indirectly through the <a href="http://www.arduino.cc/">Arduino</a> microcontroller board I picked up a few months ago, which uses a variant of Processing for its development environment.  Processing is essentially a Java-like language oriented primarily toward programming in a visual context: i.e. making graphics.  It might also be the most fun I&#8217;ve had programming anything since I wrote a Mandlebrot set generator in CBM Basic for my Commodore 64.  The immediacy of seeing something happen graphically as you code is like getting a cookie every time you hit &#8220;compile&#8221;.<span id="more-93"></span></p>
<p>Having a few days off over the holidays means I&#8217;m able to spend time playing with code a little, so I wrote what the Processing folks call a &#8220;sketch&#8221;.  Here is the result (you&#8217;ll need a Java plugin):</p>
<p><applet name="tendrils" WIDTH="400" HEIGHT="300" archive="wp-content/uploads/2009/01/tendrils.jar" standby="Loading Processing software..." codebase="http://spacebeast.com/blog/" code="tendrils" mayscript="true" scriptable="true" image="wp-content/uploads/2009/01/tendrils.png" boxmessage="Loading Processing software..." boxcolor="#FFFFFF"><br />
<img src="wp-content/uploads/2009/01/tendrils.png" alt="No Java Plug-in screenshot"/><br />
</applet> 			  </p>
<p><small><a href="wp-content/uploads/2009/01/tendrils.pde">&#8220;Tendrils&#8221; code.</a></small></p>
<p>Fun stuff!  And I haven&#8217;t even touched the 3D portions of the API, which look very tempting.  </p>
<p>Processing also has a lively community, including a <a href="http://www.flickr.com/groups/processing/">Flickr group</a> which has a lot of beautiful Processing-generated images.  The brilliant John Resig of jQuery fame has even ported the language and large portions of the API to <a href="http://ejohn.org/blog/processingjs/">Javascript</a>, using the canvas element available in modern web browsers.</p>
]]></content:encoded>
			<wfw:commentRss>http://spacebeast.com/blog/2009/01/01/programming-is-fun-again-with-processing/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>jQuery Content RegExp Selector</title>
		<link>http://spacebeast.com/blog/2008/12/16/jquery-content-regexp-selector/</link>
		<comments>http://spacebeast.com/blog/2008/12/16/jquery-content-regexp-selector/#comments</comments>
		<pubDate>Wed, 17 Dec 2008 05:52:54 +0000</pubDate>
		<dc:creator>Barry</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[selector]]></category>

		<guid isPermaLink="false">http://spacebeast.com/blog/?p=74</guid>
		<description><![CDATA[One of jQuery&#8217;s best features is the ease with which it can be extended with simple plugins. This post on customizing jQuery selectors inspired me to write the following selector extension, which matches text content in the current element set with a regular expression. Remember how I said it was simple? More like effortless, you [...]]]></description>
			<content:encoded><![CDATA[<div class="mceTemp">
<dl id="attachment_87" class="wp-caption alignright" style="width: 160px;">
<dt class="wp-caption-dt"><a href="http://jquery.com/"><img class="size-full wp-image-87" title="jQuery" src="http://spacebeast.com/blog/wp-content/uploads/2008/12/jquery.png" alt="jQuery logo" width="150" height="46" /></a></dt>
</dl>
</div>
<p>One of <a href="http://jquery.com/">jQuery&#8217;s</a> best features is the ease with which it can be extended with simple plugins.  This <a href="http://james.padolsey.com/javascript/extending-jquerys-selector-capabilities/">post on customizing jQuery selectors</a> inspired me to write the following selector extension, which matches text content in the current element set with a regular expression.  <span id="more-74"></span>Remember how I said it was simple? More like effortless, you could easily squeeze this down into a half dozen lines or so if you were so inclined.  The only slightly difficult bit is figuring out what the &#8220;a&#8221;, &#8220;i&#8221; and &#8220;m&#8221; parameters mean in the jQuery selector source.  From the looks of things &#8220;a&#8221; is the element to match, &#8220;i&#8221; is the index in the list of matched elements, and &#8220;m&#8221; is the regexp match for the selector expression where &#8220;m[3]&#8221; is the value of the parameter supplied to the selector function.</p>
<pre>[code lang="javascript"]
(function ($) {
     var match = function (a, i, m) {
         return RegExp(m[3]).test(a.textContent || a.innerText || $(a).text() || "");
     };

     var match_ignore_case = function (a, i, m) {
         return RegExp(m[3], 'i').test(a.textContent || a.innerText || $(a).text() || "");
     };

     $.extend($.expr[':'], {
                  containsmatch: match,
                  containsmatchi: match_ignore_case
              });
 })(jQuery);
[/code]</pre>
<p>With the above code loaded, &#8220;:containsmatch(&lt;regexp&gt;)&#8221; and &#8220;:containsmatchi(&lt;case insensitive regexp&gt;)&#8221; will be added to jQuery&#8217;s already generous set of selectors.  For example, [code lang="javascript"]$('p:containsmatchi(^the)')[/code] will case insensitively match any paragraph element with text content beginning with &#8220;the&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://spacebeast.com/blog/2008/12/16/jquery-content-regexp-selector/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
