<?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>Soulwire &#187; Programming</title>
	<atom:link href="http://blog.soulwire.co.uk/category/notes/programming/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.soulwire.co.uk</link>
	<description>Art + Technology</description>
	<lastBuildDate>Mon, 21 Mar 2011 22:27:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Introducing Springboard</title>
		<link>http://blog.soulwire.co.uk/laboratory/javascript/springboard-javascript-css-html-template</link>
		<comments>http://blog.soulwire.co.uk/laboratory/javascript/springboard-javascript-css-html-template#comments</comments>
		<pubDate>Mon, 21 Mar 2011 22:27:20 +0000</pubDate>
		<dc:creator>Soulwire</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Lab]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Transmissions]]></category>
		<category><![CDATA[Utilities]]></category>

		<guid isPermaLink="false">http://blog.soulwire.co.uk/?p=1312</guid>
		<description><![CDATA[I love HTML5 Boilerplate and use it a lot as a basis for web projects. Sometimes however, I find it still does a little bit too much for my needs and I end up removing a lot before I can get started. Most importantly for me though, it still currently doesn&#8217;t support building with Google [...]


Related posts:<ol><li><a href='http://blog.soulwire.co.uk/laboratory/javascript/what-the-fuck-is-my-mashup' rel='bookmark' title='Permanent Link: What The Fuck Is My Mashup?'>What The Fuck Is My Mashup?</a></li>
<li><a href='http://blog.soulwire.co.uk/code/actionscript-3/managing-runtime-loaded-dynamic-assets' rel='bookmark' title='Permanent Link: Hello Dynamic Sprite'>Hello Dynamic Sprite</a></li>
<li><a href='http://blog.soulwire.co.uk/laboratory/flash/perlin-noise-flow-field' rel='bookmark' title='Permanent Link: Perlin Noise Flow Field'>Perlin Noise Flow Field</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.soulwire.co.uk/wp-content/uploads/2011/03/springboard.jpg" alt="Springboard is an ultra minimal JavaScript / CSS and HTML project springboard." title="Springboard" width="710" height="250" class="size-full wp-image-1316" /></p>
<p>I love <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://html5boilerplate.com/"  target="_blank">HTML5 Boilerplate</a> and use it a lot as a basis for web projects. Sometimes however, I find it still does a little bit too much for my needs and I end up removing a lot before I can get started.</p>
<p>Most importantly for me though, it still currently doesn&#8217;t support building with <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://code.google.com/closure/compiler/"  target="_blank">Google Closure Compiler</a> which I tend to use both for it&#8217;s advanced code optimisations and for <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://calendar.perfplanet.com/2010/coding-better-object-oriented-javascript-with-closure-compiler/" >coding better Object-Oriented JavaScript</a> (not to mention generating JavaScript documentation from the very same comments I write for the compiler).</p>
<h2>So What&#8217;s Springboard Then?</h2>
<p><a rel="nofollow" href="http://blog.soulwire.co.uk//goto/https://github.com/soulwire/Springboard"  target="_blank"><strong>Springboard</strong></a> is an <em>ultra minimal</em> JavaScript / CSS and HTML project template (or <em>springboard</em>).</p>
<p>It features a very useful <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://ant.apache.org/"  target="_blank">ANT</a> build file which, among other things, can:</p>
<ul>
<li>Refactor template files to match your project&#8217;s namespace so you&#8217;re ready to code in seconds</li>
<li>Combine JavaScript and CSS libraries to reduce HTTP requests</li>
<li>Compile JavaScript using the <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://code.google.com/closure/compiler/"  target="_blank">Google Closure Compiler</a> <em>(simple or advanced)</em></li>
<li>Minify CSS using the <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://developer.yahoo.com/yui/compressor/"  target="_blank">YUI Compressor</a></li>
<li>Generate JavaScript documentation using the <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://code.google.com/p/jsdoc-toolkit/"  target="_blank">JSDoc Toolkit</a></li>
<li>Sanitize HTML and inject variables at compile time</li>
</ul>
<p>Also included is a simple JavaScript <strong>Model-View-Controller</strong> (MVC) template (based on <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://www.alexatnet.com/content/model-view-controller-mvc-javascript"  target="_blank">Alex Netkachov&#8217;s</a>) which can optionally be used as a basis for your project.</p>
<p>Hopefully No fluff &#8211; just the very basics you need to get a project or experiment started.</p>
<p><a rel="nofollow" href="http://blog.soulwire.co.uk//goto/https://github.com/soulwire/Springboard"  target="_blank">Check out Springboard on github</a><span id="more-1312"></span></p>
<h2>Quick Setup</h2>
<p>To get started, first clone the repository:</p>
<pre>
cd /your/workspace
git clone git@github.com:soulwire/Springboard.git YourProjectName
</pre>
<p>Run the <strong>setup</strong> task and enter your project&#8217;s namespace when prompted:</p>
<pre>
cd YourProjectName
ant setup
Enter the full project namespace for this project: com.domain.project
</pre>
<p>This will refactor the project template to match your namespace. You&#8217;ll then be given the option to delete the GIT metadata and disconnect from the Springboard repository&#8230;</p>
<p>You can build your project with the default ANT task, <strong>build</strong></p>
<pre>
ant build
</pre>
<p>And when you&#8217;re ready, generate documentation using the <strong>jsdoc</strong> task</p>
<pre>
ant jsdoc
</pre>
<p>You should also have a look at the <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/https://github.com/soulwire/Springboard/blob/master/build.properties"  target="_blank">build.properties</a> file as here you can add your credentials and tweak the various build settings to your taste.</p>
<h2>A Quick Note About Blocks</h2>
<p>Springbard uses HTML comment blocks to figure out how it should build the project. There are different types of blocks you can use:</p>
<ul>
<li><strong>CSS:LIB</strong> &raquo; Third party CSS files (combined and minified)</li>
<li><strong>CSS:SRC</strong> &raquo; Your project&#8217;s styles (combined and minified)</li>
<li><strong>JS:LIB</strong> &raquo; JavaScript dependancies (combined but otherwise left untouched)</li>
<li><strong>JS:SRC</strong> &raquo;  JavaScript source files (combined and compiled)</li>
</ul>
<p>Any linked JavaScript or CSS resources outside of these tags will simply be cloned into the build directory and left untouched for flexibility.</p>
<p>Springboard will look at all of your pages when it builds and combine all files in all blocks of the same type. There is then a generic <strong>document ready</strong> handler, which initialises scripts for a page based on the id tag of it&#8217;s body. This is best illustrated in this <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/https://github.com/soulwire/Springboard/blob/master/src/js/namespace.project.App.js" >example</a>.</p>
<h2>A Quick Note About Externs</h2>
<p>If you&#8217;ve used the Closure Compiler before, you&#8217;ll be familiar with <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://code.google.com/closure/compiler/docs/api-tutorial3.html#externs"  target="_blank">Externs</a>. Externs tell the compiler not to refactor certain methods and properties, because doing so may break your code if they reference a third party library or code not being compiled. Springboard currently ships with an externs file supporting JQuery 1.5, just to get you going. You can easily generate more for your favorite libraries using <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://www.dotnetwise.com/Code/Externs/index.html"  target="_blank">this great tool</a> by <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://blog.dotnetwise.com/2009/11/closure-compiler-externs-extractor.html"  target="_blank">Laurentiu Macovei</a> or others like it.</p>
<h2>What Springboard Doesn&#8217;t Do</h2>
<p>The primary intention of Springboard is to provide a simple but powerful project template and build file, which integrates with the Closure Compiler as well as doing the basics which you would expect; such as file concatenation and CSS minification. It&#8217;s intended to be extremely light and minimal, allowing you to take the project kernel forward in whichever way you need; whether it&#8217;s a large site build or a quick JavaScript experiment. I would imagine that future updates will strip it back and optimise it even further, as opposed to adding features.</p>
<p>So to be clear, it is in no way intended as a replacement for the amazing projects out there such as HTML5 Boilerplate; simply an option if you need less rather than more in certain situations.</p>
<p><strong>Now <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/https://github.com/soulwire/Springboard"  target="_blanl">fork off</a> and start making nice things&#8230;</strong></p>


<p>Related posts:<ol><li><a href='http://blog.soulwire.co.uk/laboratory/javascript/what-the-fuck-is-my-mashup' rel='bookmark' title='Permanent Link: What The Fuck Is My Mashup?'>What The Fuck Is My Mashup?</a></li>
<li><a href='http://blog.soulwire.co.uk/code/actionscript-3/managing-runtime-loaded-dynamic-assets' rel='bookmark' title='Permanent Link: Hello Dynamic Sprite'>Hello Dynamic Sprite</a></li>
<li><a href='http://blog.soulwire.co.uk/laboratory/flash/perlin-noise-flow-field' rel='bookmark' title='Permanent Link: Perlin Noise Flow Field'>Perlin Noise Flow Field</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.soulwire.co.uk/laboratory/javascript/springboard-javascript-css-html-template/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Noise-Reactive Particle Sphere</title>
		<link>http://blog.soulwire.co.uk/laboratory/cinder/noise-reactive-particle-sphere</link>
		<comments>http://blog.soulwire.co.uk/laboratory/cinder/noise-reactive-particle-sphere#comments</comments>
		<pubDate>Wed, 23 Feb 2011 11:01:06 +0000</pubDate>
		<dc:creator>Soulwire</dc:creator>
				<category><![CDATA[Cinder]]></category>
		<category><![CDATA[Lab]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[Audio]]></category>
		<category><![CDATA[Experiments]]></category>
		<category><![CDATA[Generative]]></category>
		<category><![CDATA[Geometry]]></category>
		<category><![CDATA[Visualisation]]></category>

		<guid isPermaLink="false">http://blog.soulwire.co.uk/?p=1289</guid>
		<description><![CDATA[Music is Ybe 76 by Subheim I&#8217;ve been trying to find more time lately to experiment with C++ and get more familiar with the OpenGL API and to achieve this have been using the excellent Cinder library. I&#8217;m a complete C++ novice and, coming from a Flash background, it&#8217;s immediately apparent how much of the [...]


Related posts:<ol><li><a href='http://blog.soulwire.co.uk/laboratory/flash/as3-tonfall-particle-node-sequencer' rel='bookmark' title='Permanent Link: AS3 Particle Node Sequencer'>AS3 Particle Node Sequencer</a></li>
<li><a href='http://blog.soulwire.co.uk/laboratory/flash/actionscript3-dynamic-sound-visualisation' rel='bookmark' title='Permanent Link: AS3 Music Visualisation'>AS3 Music Visualisation</a></li>
<li><a href='http://blog.soulwire.co.uk/laboratory/flash/perlin-noise-flow-field' rel='bookmark' title='Permanent Link: Perlin Noise Flow Field'>Perlin Noise Flow Field</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><iframe src="http://player.vimeo.com/video/20266917?title=0&amp;byline=0&amp;portrait=0&amp;color=29cad4" width="710" height="399" frameborder="0"></iframe></p>
<p><em>Music is <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://www.last.fm/music/Subheim/_/Ybe+76"  target="_blank">Ybe 76</a> by <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://www.subheim.com/"  target="_blank">Subheim</a></em></p>
<p>I&#8217;ve been trying to find more time lately to experiment with C++ and get more familiar with the OpenGL API and to achieve this have been using the excellent <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://libcinder.org/"  target="_blank">Cinder</a> library. I&#8217;m a complete C++ novice and, coming from a Flash background, it&#8217;s immediately apparent how much of the hard work had been done for you in higher level languages like AS3. Learning about pointers, memory allocation and fumbling your way around undescriptive compile errors is bit of an eye opener, although thankfully libraries like <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://libcinder.org/"  target="_blank">Cinder</a> and <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://www.openframeworks.cc/"  target="_blank">OpenFrameworks</a> help take a lot of the pain out of the transition and ultimately function as very exciting and inspiring tools to work with.<span id="more-1289"></span></p>
<p>Up until now I&#8217;ve been keeping most of these experiments to myself (although some crop up on my <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://www.flickr.com/photos/soulwire/sets/"  target="_blank">Flickr stream</a> from time to time), but I&#8217;ve decided to start sharing the processes when I can &#8211; so that you can tell me what I&#8217;m doing wrong and teach me the right way! Or, if you&#8217;re like me and are used to languages like AS3, JavaScript and Processing / Java, but are wanting to take your creative coding into other environments; maybe you can learn a little bit from what I&#8217;ve been trying.</p>
<p>Either way, the Noise Sphere experiment, though not particularly original; made me realise that the processes involved spanned many of the key aspects of programming that I&#8217;m both interested in but also keen to learn much more about.</p>
<p>The plan is to release a series of relatively quick tutorials, taking you through the process of creating the sketch you can see in the video above (and far beyond, into OpenGL shaders etc) and in doing so cover roughly the following topics:</p>
<ul>
<li>Setting up Cinder</li>
<li>Geometry: Vectors &amp; Matrices</li>
<li>Movement &amp; Dynamics</li>
<li>Procedural Mesh Generation</li>
<li>OpenGL: GLSL, Vertex &amp; Fragment Shaders</li>
</ul>
<p>I&#8217;m certainly not claiming to be an expert in these topics, in fact in some I&#8217;m only just getting started. But my hope is that I can share my discoveries as they happen and pass on knowledge I&#8217;ve picked up from the community, in case it helps other developers travelling along similar trajectories to myself. I&#8217;ve found a lot of amazing resources for learning, but have often felt that some of them would benefit from being translated for interactive developers such as myself, who come from more of a creative than technical background.</p>
<p>Pester me if part one isn&#8217;t out soon!</p>


<p>Related posts:<ol><li><a href='http://blog.soulwire.co.uk/laboratory/flash/as3-tonfall-particle-node-sequencer' rel='bookmark' title='Permanent Link: AS3 Particle Node Sequencer'>AS3 Particle Node Sequencer</a></li>
<li><a href='http://blog.soulwire.co.uk/laboratory/flash/actionscript3-dynamic-sound-visualisation' rel='bookmark' title='Permanent Link: AS3 Music Visualisation'>AS3 Music Visualisation</a></li>
<li><a href='http://blog.soulwire.co.uk/laboratory/flash/perlin-noise-flow-field' rel='bookmark' title='Permanent Link: Perlin Noise Flow Field'>Perlin Noise Flow Field</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.soulwire.co.uk/laboratory/cinder/noise-reactive-particle-sphere/feed</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>What The Fuck Is My Mashup?</title>
		<link>http://blog.soulwire.co.uk/laboratory/javascript/what-the-fuck-is-my-mashup</link>
		<comments>http://blog.soulwire.co.uk/laboratory/javascript/what-the-fuck-is-my-mashup#comments</comments>
		<pubDate>Mon, 07 Feb 2011 16:56:46 +0000</pubDate>
		<dc:creator>Soulwire</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Generative]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Lab]]></category>
		<category><![CDATA[Miscellany]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Algorithm]]></category>
		<category><![CDATA[Experiments]]></category>

		<guid isPermaLink="false">http://blog.soulwire.co.uk/?p=1279</guid>
		<description><![CDATA[The fruits of a Sunday hangover; What The Fuck Is My Mashup? is an idea generator for ridiculous (but sometimes plausible) mashups. Inspired by What The Fuck Should I Make For Dinner by Zach Golden, WTFIMM is a simple JavaScript based randomiser that takes a series of templates and a corpus of words and turns [...]


Related posts:<ol><li><a href='http://blog.soulwire.co.uk/laboratory/javascript/springboard-javascript-css-html-template' rel='bookmark' title='Permanent Link: Introducing Springboard'>Introducing Springboard</a></li>
<li><a href='http://blog.soulwire.co.uk/laboratory/flash/as3-bitmapdata-glitch-generator' rel='bookmark' title='Permanent Link: Smack My Glitch Up'>Smack My Glitch Up</a></li>
<li><a href='http://blog.soulwire.co.uk/laboratory/flash/as3-tonfall-particle-node-sequencer' rel='bookmark' title='Permanent Link: AS3 Particle Node Sequencer'>AS3 Particle Node Sequencer</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.soulwire.co.uk/wp-content/uploads/2011/02/wtfimm.jpg" alt="What The Fuck Is My Mashup" title="What The Fuck Is My Mashup" width="710" height="360" /></p>
<p>The fruits of a Sunday hangover; <a href="http://whatthefuckismymashup.com/"  title="What The Fuck Is My Mashup" target="_blank">What The Fuck Is My Mashup?</a> is an idea generator for ridiculous (but sometimes plausible) <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://en.wikipedia.org/wiki/Mashup_(web_application_hybrid)"  target="_blank">mashups</a>.<span id="more-1279"></span></p>
<p>Inspired by <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://www.whatthefuckshouldimakefordinner.com/" >What The Fuck Should I Make For Dinner</a> by <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://www.zachgolden.com/"  target="_blank">Zach Golden</a>, <strong>WTFIMM</strong> is a simple JavaScript based randomiser that takes a series of templates and a corpus of words and turns them into concepts that utilise the latest technologies, APIs and social media platforms.</p>
<p>I&#8217;ve abstracted the code into a simple framework which I&#8217;ve called the <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/https://github.com/soulwire/WTFEngine"  target="_blank">WTF Engine</a>, that allows you to create a generator for any subject.</p>
<p>Here are a few of my favourite generative mashups so far:</p>
<ul>
<li>Blackberry application that generates poetry based on Yelp data</li>
<li>Platform for building Wii controlled, memcached dashboard widgets for Open Frameworks enabled devices</li>
<li>Windows optimised GMail configurator for social microblogging</li>
<li>Podcast that generates poetry based on Google Earth data</li>
<li>Scalable, PHP based Feedburner API explorer with a hand tracking front-end</li>
<li>Feature detecting blogging platform for Lingo, Haxe and AS3</li>
<li>Pascal based kiosk to replace data visualisations and hook into GMail via Twitter and Google Maps</li>
<li>Multi-touch, open source Digg microblogging utility powered by Slashdot and the Google Gears C# API</li>
<li>Platform for building dynamic, Wii controlled iPad applications for MATLAB enabled devices</li>
<li>Python based Del.icio.us and GitHub mashup, designed for generative gaming</li>
<li>Objective C interpreter for creating dynamic microblogging experiences in JavaScript</li>
<li>Scalable, Wii controlled GitHub shopping utility powered by Foursquare &#038; the Yahoo Pipes API</li>
<li>Ajax based platform for rapidly developing kiosks based on Google Gears data</li>
<li>Perl based platform for rapidly developing art installations based on GitHub data</li>
</ul>
<p>The <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/https://github.com/soulwire/WTFEngine"  target="_blank">WTF Engine code</a> and this particular implementation is available in my <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/https://github.com/soulwire"  target="_blank">GitHub repository</a>.</p>
<p>Have fun, and if for any bizarre reason you make one of them, let me know!</p>
<p><a href="http://whatthefuckismymashup.com/"  target="_blank" title="What The Fuck Is My Mashup">http://whatthefuckismymashup.com/</a></p>


<p>Related posts:<ol><li><a href='http://blog.soulwire.co.uk/laboratory/javascript/springboard-javascript-css-html-template' rel='bookmark' title='Permanent Link: Introducing Springboard'>Introducing Springboard</a></li>
<li><a href='http://blog.soulwire.co.uk/laboratory/flash/as3-bitmapdata-glitch-generator' rel='bookmark' title='Permanent Link: Smack My Glitch Up'>Smack My Glitch Up</a></li>
<li><a href='http://blog.soulwire.co.uk/laboratory/flash/as3-tonfall-particle-node-sequencer' rel='bookmark' title='Permanent Link: AS3 Particle Node Sequencer'>AS3 Particle Node Sequencer</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.soulwire.co.uk/laboratory/javascript/what-the-fuck-is-my-mashup/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Carols in Code</title>
		<link>http://blog.soulwire.co.uk/notes/programming/carols-in-code</link>
		<comments>http://blog.soulwire.co.uk/notes/programming/carols-in-code#comments</comments>
		<pubDate>Fri, 24 Dec 2010 14:39:48 +0000</pubDate>
		<dc:creator>Soulwire</dc:creator>
				<category><![CDATA[Miscellany]]></category>
		<category><![CDATA[Notes]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://blog.soulwire.co.uk/?p=1216</guid>
		<description><![CDATA[I caught wind of the #CarolsInCode Twitter meme last night. Similar to the #SongsInCode meme, programmers have been merrily expressing famous Christmas carols or songs in code form; either by using the lyrics themselves or expressing the songs structure / message. Here are my contributions: you.push(new Christmas(State.MERRY, Size.LITTLE)); you.getOrgan("heart").setDensity(0.0); you.troubles.setVisible(false); My take on GrumpyWookie&#8216;s tweet: [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>I caught wind of the <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://twitter.com/search/%23carolsincode"  target="_blank">#CarolsInCode</a> Twitter meme last night. Similar to the <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://songsincodedb.com/"  target="_blank">#SongsInCode</a> meme, programmers have been merrily expressing famous Christmas carols or songs in code form; either by using the lyrics themselves or expressing the songs structure / message.</p>
<p>Here are my contributions:</p>
<p><span id="more-1216"></span></p>
<pre>you.push(new Christmas(State.MERRY, Size.LITTLE));
you.getOrgan("heart").setDensity(0.0);
you.troubles.setVisible(false);</pre>
<p>My take on <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://twitter.com/GrumpyWookie"  target="_blank">GrumpyWookie</a>&#8216;s tweet:</p>
<pre>if(weather == "frightful") {
	fire.setState("delightful");
	us.velocity.set(0,0,0);
	for(i=0;i< 3;++i) {
		weather.snow();
	}
}</pre>
<p>This was picked up by <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://twitter.com/simon_watkins"  target="_blank">simon_watkins</a> who later added some logic:</p>
<pre>for each(Angel angel in angels) {
	angel.addEventListener(AudioEvent.SING, hark);
}</pre>
<p>Technically, this would see them ascending into space, but you get the idea!</p>
<pre>Vec3 v;
for each(King k in kings) {
	v = star.position - k.position;
	v.normalise();
	v.scale(k.maxSpeed);
	k.position += v;
}</pre>
<p>What Christmas would be complete with out a bit of Wham! (that's rhetorical).</p>
<pre>heart = you.hearts.pop();
for each(Person someone in world) {
	if(someone.isSpecial()) {
		someone.push(heart);
		return;
	}
}</pre>
<p>And if you thought all this Christmas cheer was unbefitting of an Atheist, here's my take on this one:</p>
<pre>try {
	God.getInstance().rest(merryGentleman);
} catch(TheologyError error) {
	log("God not found");
	Christmas.abort();
}</pre>
<p>I'm not sure whether anyone is archiving these, as they did with <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://songsincodedb.com/"  target="_blank">SongsInCode</a> but for now you can see more <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://www.retroprogramming.com/2010/12/carolsincode-top-five-countdown.html"  target="_blank">here</a>, <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://www.weedoorsbanging.com/archives/carols-in-code.html"  target="_blank">here</a> and of course <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://twitter.com/search/%23carolsincode"  target="_blank">here</a>.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.soulwire.co.uk/notes/programming/carols-in-code/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Subversive &amp; Google Code</title>
		<link>http://blog.soulwire.co.uk/notes/programming/eclipse-fdt-subversive-svn-google-code</link>
		<comments>http://blog.soulwire.co.uk/notes/programming/eclipse-fdt-subversive-svn-google-code#comments</comments>
		<pubDate>Fri, 06 Feb 2009 19:43:55 +0000</pubDate>
		<dc:creator>Soulwire</dc:creator>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[FDT]]></category>
		<category><![CDATA[Subversion]]></category>

		<guid isPermaLink="false">http://blog.soulwire.co.uk/?p=296</guid>
		<description><![CDATA[I’ve recently started weaning myself off of Flashdevelop and onto FDT, mainly because it’s cross platform but also because it means I can use the same IDE for coding and compiling Actionscript and Java. The other clinching factor was it’s plugins, notably Subversive for SVN browsing and team collaboration goodness. This evening though, I tried [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>I’ve recently started weaning myself off of <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://www.flashdevelop.org/" >Flashdevelop</a> and onto <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://fdt.powerflasher.com/" >FDT</a>, mainly because it’s cross platform but also because it means I can use the same IDE for coding and compiling Actionscript and Java.</p>
<p>The other clinching factor was it’s plugins, notably <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://www.polarion.org/index.php?page=overview&amp;project=subversive" >Subversive</a> for SVN browsing and team collaboration goodness.</p>
<p>This evening though, I tried checking out a Google code project and got the following error:<span id="more-296"></span></p>
<pre>
SVN: ‘0×00400006: Validate Repository Location’ operation finished with error: Selected SVN connector library is not available or cannot be loaded.
If you selected native JavaHL connector, please check if binaries are available or install and select pure Java Subversion connector from the plug-in connectors update site.

If connectors already installed then you can change the selected one at: Window->Preferences->Team->SVN->SVN Client.

Selected SVN connector library is not available or cannot be loaded.

If you selected native JavaHL connector, please check if binaries are available or install and select pure Java Subversion connector from the plug-in connectors update site.

If connectors already installed then you can change the selected one at: Window->Preferences->Team->SVN->SVN Client.
</pre>
<p>Basically, it was banging on about <strong>connectors</strong>, so&#8230;</p>
<p>In case anyone is experiencing the same thing, here’s what I did to solve it:</p>
<ol>
<li>Open up the <em>Software Updates and Add-ons</em> dialogue (<strong>Help &gt; Software Updates</strong>)</li>
<li>Click <em>Add Site</em> and enter the <strong>Polaron SVN Connectors update site</strong> URL:<br /><a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://www.polarion.org/projects/subversive/download/eclipse/2.0/update-site/" >http://www.polarion.org/projects/subversive/download/eclipse/2.0/update-site/</a><br /><em>(I found this on the <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://www.polarion.org/index.php?page=download&amp;project=subversive" >Polaron download page</a>)</em></li>
<li><a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://www.polarion.org/projects/subversive/download/eclipse/2.0/update-site/" ></a>Open up the <strong>Subversive Connectors Site</strong> node, then <strong>Subversive SVN Connectors</strong></li>
<li>Download the following plugins:
<ul>
<li>Subversive SVN Connectors</li>
<li>SVNKit 1.1.7 Implementation</li>
</ul>
</li>
</ol>
<p><strong>Restart Eclipse</strong> (or FDT standalone) when prompted and that seemed to do the trick.</p>
<p>I’m new to FDT and Eclipse, so let me know I was missing something.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.soulwire.co.uk/notes/programming/eclipse-fdt-subversive-svn-google-code/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Masking Transparent Bitmaps</title>
		<link>http://blog.soulwire.co.uk/code/actionscript-3/gradient-alpha-masks-on-transparent-bitmaps</link>
		<comments>http://blog.soulwire.co.uk/code/actionscript-3/gradient-alpha-masks-on-transparent-bitmaps#comments</comments>
		<pubDate>Wed, 10 Dec 2008 16:15:49 +0000</pubDate>
		<dc:creator>Soulwire</dc:creator>
				<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://blog.soulwire.co.uk/?p=233</guid>
		<description><![CDATA[Original image by Edwin Tofslie I was having a few gradient alpha mask disabilities today and thought I should share my misery and consequential solution with anyone who might run into the same problems! Update: TF pointed out a very simple solution – cacheAsBitmap WILL work, providing you cache the Bitmap as a Bitmap, as [...]


Related posts:<ol><li><a href='http://blog.soulwire.co.uk/code/actionscript-3/fit-a-displayobject-into-a-rectangle' rel='bookmark' title='Permanent Link: Fit DisplayObject into Rectangle'>Fit DisplayObject into Rectangle</a></li>
<li><a href='http://blog.soulwire.co.uk/code/actionscript-3/extract-average-colours-from-bitmapdata' rel='bookmark' title='Permanent Link: BitmapData Average Colours'>BitmapData Average Colours</a></li>
<li><a href='http://blog.soulwire.co.uk/code/actionscript-3/colourutils-bitmapdata-extract-colour-palette' rel='bookmark' title='Permanent Link: BitmapData Colour Palette'>BitmapData Colour Palette</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.soulwire.co.uk/wp-content/uploads/2008/12/bitmap-alpha-mask-4.jpg" alt="Bitmap Alpha Channel Masking using CopyPixels" title="Bitmap Alpha Channel Masking using CopyPixels" width="710" height="223" class="alignnone size-full wp-image-571" /></p>
<p><em>Original image by <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://www.tofslie.com/"  target="_blank">Edwin Tofslie</a></em></p>
<p>I was having a few <strong>gradient alpha mask</strong> disabilities today and thought I should share my misery and consequential solution with anyone who might run into the same problems!<span id="more-233"></span></p>
<blockquote><p><em>Update: </em>TF pointed out a very simple solution – cacheAsBitmap WILL work, providing you cache the Bitmap as a Bitmap, as you would if you were working with two vector drawings. Why a Bitmap wouldn’t be cached as a Bitmap I don’t fully understand.<br />
Still use the copyPixels method if you want to create a single object and discard the mask, but otherwise don’t listen to me overcomplicating things and do it old school!</p></blockquote>
<p>As you know, since Flash Player 8 we’ve been able to use an alpha channel when masking display objects. A common implementation is to first draw a gradient that fades from white with opacity 1 to white with opacity 0 and then tell a display object to use this as its mask.</p>
<p>Apparently, however &#8211; it’s not always that simple&#8230;</p>
<p>In this instance, I was using an embedded image (though the same would be true for a loaded one) which was in PNG format and contained an <strong>alpha channel</strong>. The alpha channel was crucial as the image was an icon with a transparent background and faded edges. I needed to dynamically mask and fade out this image to create a reflection via code, rather than doing this all in Photoshop. The resulting Bitmap would be sitting on top of a colour changing background, and so transparency was needed on both the original icon shape and the fading reflection – a common enough requirement.</p>
<h2>The &#8220;cacheAsBitmap&#8221; Approach</h2>
<p>The simplest way to do this and the technique that I immediately reached for, is to create the mask – being a Shape object with a gradient drawn using its instance of the Graphic class – set it’s <strong>cacheAsBitmap </strong>property to <em>true</em> and then set the embedded Bitmap’s mask property to use this gradient.</p>
<p><strong>The result:</strong></p>
<p><img title="Using cacheAsBitmap to create an Alpha gradient mask" src="http://blog.soulwire.co.uk/wp-content/uploads/2008/12/bitmap-alpha-mask-2.jpg" alt="Using cacheAsBitmap to create an Alpha gradient mask" /></p>
<p><strong>The code:</strong></p>
<pre lang="actionscript">[Embed(source = '../lib/image.png')]
private var image:Class;

var myImage:Bitmap = new image as Bitmap;
addChild( myImage );

var matrix:Matrix = new Matrix();
matrix.createGradientBox( myImage.width, myImage.height, Math.PI / 2 );

var gradient:Shape = new Shape();
gradient.graphics.beginGradientFill( 'linear', [0xFFFFFF, 0xFFFFFF], [1, 0], [0, 255], matrix );
gradient.graphics.drawRect(0, 0, myImage.width, myImage.height);
gradient.graphics.endFill();
gradient.cacheAsBitmap = true;

myImage.mask = gradient;</pre>
<p><del datetime="2008-12-12T13:00:00+00:00">However, presumably due to the fact that the bitmap already contained an alpha channel, the alpha channel of the bitmap-cached gradient shape was ignored, and the result is a mask which is simply the entire area of the gradient box, much like the pre Flash Player 8 mask behaviour of being either <em>on</em> or <em>off</em> and nothing in between.</del> (</p>
<h2>The &#8220;CopyChannel&#8221; Approach</h2>
<p>The next approach I tried was to <em>draw the gradient to a new transparent</em> bitmapdata and then use the <strong>copyChannel </strong>method to copy the alpha channel of the gradient bitmapdata to the bitmapdata of my image.</p>
<p><strong>The result:</strong></p>
<p><img title="Using BitmapData.copyChannel to create an Alpha gradient mask" src="http://blog.soulwire.co.uk/wp-content/uploads/2008/12/bitmap-alpha-mask-3.jpg" alt="Using BitmapData.copyChannel to create an Alpha gradient mask" /></p>
<p><strong>The code:</strong></p>
<pre lang="actionscript">var gradientBitmap:BitmapData = new BitmapData( gradient.width, gradient.height, true, 0 );
gradientBitmap.draw( gradient );

var channel:uint = BitmapDataChannel.ALPHA;

myImage.bitmapData.copyChannel(gradientBitmap, gradientBitmap.rect, new Point(), channel, channel);</pre>
<p>Again, an undesirable result – I was left with some kind of graphic monstrosity that was a Frankenstein combination of my wonderfully smooth faded source image and a gradient showing through wherever transparency should have been in the original.</p>
<h2>The solution (CopyPixels)</h2>
<p>The approach I used in the end was to create a new transparent bitmapdata with the same dimensions of my image, then to use the <strong>copyPixels</strong> method to copy over the pixels from my source image to the new bitmapdata. The copyPixels method also accepts a parameter for <strong>alphaBitmapData</strong>, so I passed my gradient bitmapdata to this. Finally, copyPixels also takes a Boolean value for <strong>mergeAlpha</strong>, so set this to <em>true</em> and the result is a brand new image with the RGB pixel data of the source image and an alpha channel which is a combination of the alpha channels from both the source and the gradient bitmap.</p>
<p><strong>The result:</strong></p>
<p><img title="Using BitmapData. copyPixels to create an Alpha gradient mask" src="http://blog.soulwire.co.uk/wp-content/uploads/2008/12/bitmap-alpha-mask-4.jpg" alt="Using BitmapData. copyPixels to create an Alpha gradient mask" /></p>
<p><strong>The code:</strong></p>
<pre lang="actionscript">var gradientBitmap:BitmapData = new BitmapData( gradient.width, gradient.height, true, 0 );
gradientBitmap.draw( gradient );

var result:BitmapData = new BitmapData( myImage.width, myImage.height, true, 0 );
result.copyPixels(myImage.bitmapData, result.rect, new Point(), gradientBitmap, new Point(), true);

addChild( new Bitmap( result ) );</pre>
<p>I’m sure I’ll be mocked by my fellow developers for having been kneecapped by this quite basic problem, but having glanced at a few forum posts it seems common enough. Therefore I felt sharing the solution might be of some benefit.</p>
<p><strong>Full source code:</strong></p>
<pre lang="actionscript">[Embed(source = '../lib/image.png')]
private var image:Class;

public function Main():void
{
	drawCheckerboardPattern();

	var myImage:Bitmap = new image as Bitmap;

	var matrix:Matrix = new Matrix();
	matrix.createGradientBox( myImage.width, myImage.height, Math.PI / 2 );

	var linear:String = GradientType.LINEAR;
	var colors:Array = [0xFFFFFF, 0xFFFFFF];
	var alphas:Array = [1.0, 0.0];
	var ratios:Array = [0.0, 255];
	var spread:String = SpreadMethod.PAD;

	var gradient:Shape = new Shape();
	gradient.graphics.beginGradientFill( linear, colors, alphas, ratios, matrix, spread );
	gradient.graphics.drawRect(0, 0, myImage.width, myImage.height);
	gradient.graphics.endFill();

	var gradientBitmap:BitmapData = new BitmapData( gradient.width, gradient.height, true, 0 );
	gradientBitmap.draw( gradient );

	var result:BitmapData = new BitmapData( myImage.width, myImage.height, true, 0 );
	result.copyPixels( myImage.bitmapData, result.rect, new Point(), gradientBitmap, new Point(), true );

	addChild( new Bitmap( result ) );
}

private function drawCheckerboardPattern():void
{
	var boxSize:int = 8;

	var pattern:BitmapData = new BitmapData( boxSize * 2, boxSize * 2, false );
	pattern.fillRect( new Rectangle( 0, 0, boxSize, boxSize ), 0xCCCCCC );
	pattern.fillRect( new Rectangle( boxSize, boxSize, boxSize, boxSize ), 0xCCCCCC );

	graphics.beginBitmapFill( pattern );
	graphics.drawRect( 0, 0, stage.stageWidth, stage.stageHeight );
	graphics.endFill();
}</pre>


<p>Related posts:<ol><li><a href='http://blog.soulwire.co.uk/code/actionscript-3/fit-a-displayobject-into-a-rectangle' rel='bookmark' title='Permanent Link: Fit DisplayObject into Rectangle'>Fit DisplayObject into Rectangle</a></li>
<li><a href='http://blog.soulwire.co.uk/code/actionscript-3/extract-average-colours-from-bitmapdata' rel='bookmark' title='Permanent Link: BitmapData Average Colours'>BitmapData Average Colours</a></li>
<li><a href='http://blog.soulwire.co.uk/code/actionscript-3/colourutils-bitmapdata-extract-colour-palette' rel='bookmark' title='Permanent Link: BitmapData Colour Palette'>BitmapData Colour Palette</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.soulwire.co.uk/code/actionscript-3/gradient-alpha-masks-on-transparent-bitmaps/feed</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>SWF Address</title>
		<link>http://blog.soulwire.co.uk/notes/programming/swf-address-deep-linking-for-flash</link>
		<comments>http://blog.soulwire.co.uk/notes/programming/swf-address-deep-linking-for-flash#comments</comments>
		<pubDate>Wed, 18 Jul 2007 12:39:04 +0000</pubDate>
		<dc:creator>Soulwire</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.soulwire.co.uk/?p=40</guid>
		<description><![CDATA[I have just been checking out Asual’s SWFAddress. If you haven’t come across it yet, SWF Address is a tool for deep linking in Flash. It is a JavaScript based code which will set hash (anchor) link path from your Flash content. Not only does this mean users can now use their back buttons, but [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>I have just been checking out Asual’s <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://www.asual.com/swfaddress/" title="SWF Address"  target="_blank">SWFAddress</a>.</p>
<p>If you haven’t come across it yet, SWF Address is a tool for deep linking in Flash. It is a JavaScript based code which will set hash (anchor) link path from your Flash content. Not only does this mean users can now use their back buttons, but it also means permalinks can be created to content deep inside the Flash movie. For example <em><strong>http://www.yoursite.com/#/projects/project-name/</strong></em><span id="more-40"></span></p>
<p>I will be working on implementing it on <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://www.flash-in-the-pan.org/" title="Flash in the Pan - Flash website design awards"  target="_blank">Flash in the Pan website awards</a>, as I have already used rewrite rules to fetch Flash content when the user arrives from a page specific link or search engine result, but SWF Address will add a much needed real-time feedback on the users’ position within the sites data.</p>
<p>You can download SWF Address <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://www.asual.com/swfaddress/" title="download swf address"  target="_blank">here</a> and will see an <a rel="nofollow" href="http://blog.soulwire.co.uk//goto/http://www.asual.com/swfaddress/samples/flash/" title="SWF Address example"  target="_blank">example</a> implementation of SWF address on soulwire or one of my other sites very soon.</p>
<p>Finally, between <strong>SWF Address</strong> and <strong>SWF Object</strong>, flash is becoming more and more usable as a coherent and complete format for large and SEO friendly sites.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.soulwire.co.uk/notes/programming/swf-address-deep-linking-for-flash/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

