<?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>20papercups :: Michael Marner&#039;s Website</title>
	<atom:link href="http://www.20papercups.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.20papercups.net</link>
	<description>The (awesome) website of Michael Marner</description>
	<lastBuildDate>Mon, 24 May 2010 13:29:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>What I think of Ubuntu 10.4</title>
		<link>http://www.20papercups.net/linux/what-i-think-of-ubuntu-10-4/</link>
		<comments>http://www.20papercups.net/linux/what-i-think-of-ubuntu-10-4/#comments</comments>
		<pubDate>Mon, 24 May 2010 13:24:07 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.20papercups.net/?p=327</guid>
		<description><![CDATA[I&#8217;ve been using Ubuntu since the 6.06 beta. It is my main operating system on my desktop at home, computer in the lab, and my laptop. Normally, I do distribution upgrades. This shields me from a lot of the changes happening around me; the user experience doesn&#8217;t change that much when I&#8217;ve already got everything [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.20papercups.net/wp-content/uploads/2010/05/Ubuntu-logo.gif"><img class="alignleft size-thumbnail wp-image-328" title="Ubuntu-logo" src="http://www.20papercups.net/wp-content/uploads/2010/05/Ubuntu-logo-150x150.gif" alt="" width="124" height="124" /></a>I&#8217;ve been using Ubuntu since the 6.06 beta. It is my main operating system on my desktop at home, computer in the lab, and my laptop. Normally, I do distribution upgrades. This shields me from a lot of the changes happening around me; the user experience doesn&#8217;t change that much when I&#8217;ve already got everything setup how I want. However, I just had to do a fresh install on my desktop. While my home directory is backed up, I am currently looking at a default user desktop. So, what do I think?<span id="more-327"></span></p>
<p>To be honest, I am not all that impressed with 10.4. Why you ask?</p>
<h3>Font rendering in Firefox is broken</h3>
<p>The first thing I notice with fresh Linux distribution is both the choice of default fonts, and the default font rendering. This is no problem, Gnome&#8217;s appearance dialog lets me easily configure anti-aliasing and sub-pixel smoothing how I want. There&#8217;s just one problem: Firefox completely ignores these settings!</p>
<p>To be more specific, it ignores the font smoothing settings and does it&#8217;s own, dog ugly version. There is a bug report for this <a href="https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/559149">here</a>. By the looks of things, there is a workaround, but I haven&#8217;t tried that yet. The workaround involves removing config files in /etc, and running a console command to reconfigure fontconfig.</p>
<p>This is a ridiculous oversight when Firefox is one of the flagship applications shipping with Ubuntu.</p>
<h3>Update Manager thinks it&#8217;s the most important app on the system</h3>
<p>This technically was introduced in an earlier version, I&#8217;m just surprised they haven&#8217;t changed the default behaviour by now. See, Update Manager pops up it&#8217;s main window if it finds updates it thinks you should install, on top of whatever you happen to be doing. This is both intrusive, and annoying. I don&#8217;t have any data, but I&#8217;m willing to bet users are more likely to dismiss the dialog instead of installing updates when it gets in their way.</p>
<p>This is a similar problem with Windows deciding it needs to reboot after an update, nomatter what you think to the contrary. I understand the Ubuntu devs are worried that the bright red icon in the notification area isn&#8217;t enough to get people to click. However, putting it in their face is even worse, as Windows has shown with the Cancel/Allow UAC dialogs. People don&#8217;t read dialogs! A much better solution would be to put the lovely new notification system to use. Just a subtle notification message every 10 minutes or whatever would be much more affective, without getting in everyone&#8217;s way.</p>
<h3>Nautilus&#8217;s Address Bar is missing!</h3>
<p>What the hell!? Stop with this Apple induced breadcrumb navigation nonsense. I want to type a path into an address bar. In previous versions of Ubuntu, there was a button to toggle between breadcrumbs and textual address bar. In 10.4, that button is gone. The only solution is to enter the following into a console:</p>
<pre>
<pre><code>gconftool-2 --type=Boolean --set /apps/nautilus/preferences/always_use_location_entry true</code></pre>
</pre>
<p>Of course, you need to enter a similar command to get back to breadcrumbs. Here&#8217;s what I really don&#8217;t understand: Ubuntu is a distribution that specifically tries to remove the need to go to the command prompt. By removing a single toggle button, they have removed the ability to enter paths directly, something that most of the people migrating to Ubuntu (Windows users) have always been able to do. Just put the button back.</p>
<h3>My iPod doesn&#8217;t show up in Banshee</h3>
<p>Arg! I&#8217;ve been having this problem intermittently for a while. I also admit that Banshee isn&#8217;t a program installed by default. But I don&#8217;t like Rhythmbox, and would really like Banshee to work again.</p>
<h3>Window controls on the left</h3>
<p>I hate this on Macs, and I hate it here too. Please give an easy option in Appearance Properties to flip the location of the buttons. Luckily, New Wave, my theme of choice still has the controls on the right.</p>
<h3>The mish-mash 10.4 theme</h3>
<p>I <em>love</em> the look of Ubuntu in 9.10. The grey was a cool getaway from the orange. 10.4 kind of builds on this, and in other ways pulls it in another direction. Now there&#8217;s added purple!. The login screen is the ugliest Ubuntu login screen ever. The default Ubuntu theme seems to be a mashup of three different themes: The cool black stuff from 9.10, the new purple stuff, and the old orange Human theme. Pick one, and refine it please.</p>
<h3>Still need to open gconf-editor to get Computer, Home, Trash icons on desktop</h3>
<p>If you aren&#8217;t familiar with gconf-editor, it is basically regedit for all of Gnome&#8217;s settings. Apparently in Ubuntu 10.4, you still need to use this to get icons such as Computer, Home, and Trash to appear on the desktop. This is incredibly confusing to new people (I just happened to remember what keys needed to be set). In my opinion, opening gconf-editor is worse than using the console, something the Ubuntu UI guys are dead against.</p>
<p>While we&#8217;re on the topic, the way you change the massive icon size on the desktop is to edit the <em>Default Zoom Level</em> in Nautilus&#8217;s settings. This is also incredibly unintuitive.</p>
<h3>Is there anything good?</h3>
<p>I like getting new versions of all the programs I use every day. Again, Ubuntu 10.4 doesn&#8217;t disappoint here. Everything is nice and fresh. There&#8217;s nothing really surprising here.</p>
<h3>Conclusion</h3>
<p>This is my least favourite default Ubuntu install since 6.06. I feel some of these things are so obvious it&#8217;s almost strange mentioning them. I&#8217;ll again point out that Ubuntu is my OS of choice for <em>actually getting work done</em>. I have a Windows virtual machine for the sole purpose of running Office and Photoshop. I use Ubuntu every day, and really want to see it get better. I speak up, because I care. So with that, please keep the flaming to a minimum, and sorry about the rant.</p>
<p>Michael</p>
]]></content:encoded>
			<wfw:commentRss>http://www.20papercups.net/linux/what-i-think-of-ubuntu-10-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Augmented Foam Sculpting for Capturing 3D Models</title>
		<link>http://www.20papercups.net/unisa/augmented-foam-sculpting/</link>
		<comments>http://www.20papercups.net/unisa/augmented-foam-sculpting/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 03:43:21 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Augmented Reality]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[UniSA]]></category>
		<category><![CDATA[foam cutter]]></category>
		<category><![CDATA[industrial design]]></category>
		<category><![CDATA[sar]]></category>
		<category><![CDATA[sculpting]]></category>

		<guid isPermaLink="false">http://www.20papercups.net/?p=305</guid>
		<description><![CDATA[This weekend I presented my paper, Augmented Foam Sculpting for Capturing 3D Models, at the International symposium on 3D user interfaces. Since the conference has passed, I have added the video to youtube and the paper to my publications page. First, the video, then some discussion after the jump. Foam Sculpting The inspiration for this [...]]]></description>
			<content:encoded><![CDATA[<p>This weekend I presented my <a href="http://www.20papercups.net/wp-content/uploads/2009/09/foamcutter.pdf">paper</a>, Augmented Foam Sculpting for Capturing 3D Models, at the International symposium on 3D user interfaces. Since the conference has passed, I have added the video to youtube and the paper to my publications page. First, the video, then some discussion after the jump.</p>
<p style="text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/VPUT2l5JvT0&amp;hl=en&amp;fs=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/VPUT2l5JvT0&amp;hl=en&amp;fs=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<h3><span id="more-305"></span>Foam Sculpting</h3>
<p>The inspiration for this work came out of a project we did with some industrial design students. Their job was to create some input devices for my SAR Airbrushing system. First up, we had a  meeting where I showed them a very early stages of development version of the system, to give them an idea of what we were doing. They went away and came up with ideas for input devices, and in the next meeting had a bunch of sketches ready. We discussed the sketches; what we liked and what we didn&#8217;t like. Next, they brought us foam mockups of some of the designs. We discussed these, and then eventually they came back with full CAD models ready for 3D printing. They did a great job by the way. But it got us thinking:</p>
<p><em><strong>How can we make this process better?</strong></em></p>
<p>Augmented Foam Sculpting is the result of this work. It allows a designer/artist to simultaneously create a physical design mockup and matching virtual model. This is a Good Thing™, because it utilises the skills and tools that designers are already using.</p>
<p>The system works by tracking the position and orientation of both the hot wire foam cutter, and the piece of foam the user is sculpting. We can track the motion of the hot wire as it passes through the foam. From there, we can create geometry that matches the cut path, and perform a Boolean difference operation on the foam geometry, to replicate the cut in the virtual model (Before any of you &#8220;Booleans are evil&#8221; people get to me, I&#8217;d like to point out I&#8217;m only dealing with, and creating, triangle meshes. There are no 11 sided polygons here).</p>
<p>Using projectors, we can add extra information to the foam as the user sculpts. We implemented 2 visualisations to aid designers when creating specific models. <strong>Cut Animation</strong> displays cuts to be made as animated lines on the foam surface. Once a cut has been made, the system moves to the next one. This visualisation could be used to recreate a previous object, or to instruct novices. An algorithm could be developed to calculate the actual cuts that need to be made, reducing the amount of planning needed when making an object.</p>
<p>The second visualisation, <strong>Target</strong>, projects a target model so that it appears to be inside the foam. The foam is coloured based on how much needs to be removed to match a target model. This could be used to create variations on a previous model.</p>
<p>Finally, we can use 3D procedural textures to change the appearance of the foam. For example, we implemented a wood grain 3D texture. This works pretty well, because as you cut away the foam, the texture updates to appear as though the wood was actually cut. 3D textures are also ideal because we don&#8217;t need to generate texture coordinates after each cut.</p>
<p>For all the details, please have a read of the paper. If you have any questions/comments/feedback/abuse, please comment on this post, or send me an email.</p>
<p>Michael</p>
]]></content:encoded>
			<wfw:commentRss>http://www.20papercups.net/unisa/augmented-foam-sculpting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shameless Plug: Swiftless&#8217; Game Programming Tutorials</title>
		<link>http://www.20papercups.net/random-news/shameless-plug-swiftless-game-programming-tutorials/</link>
		<comments>http://www.20papercups.net/random-news/shameless-plug-swiftless-game-programming-tutorials/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 08:29:12 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Random News]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.20papercups.net/?p=292</guid>
		<description><![CDATA[Time for another shameless plug. This time it is for Swiftless, a guy who I work with in the Wearable Computer Lab. His website has some pretty awesome tutorials on game programming, OpenGL, Shaders, game related maths and heaps more. Check it out! http://www.swiftless.com]]></description>
			<content:encoded><![CDATA[<p>Time for another shameless plug. This time it is for Swiftless<a href="http://www.20papercups.net/wp-content/uploads/2008/12/fonzie.jpeg"><img class="alignleft size-full wp-image-12" title="fonzie" src="http://www.20papercups.net/wp-content/uploads/2008/12/fonzie.jpeg" alt="" width="120" height="120" /></a>, a guy who I work with in the Wearable Computer Lab. His website has some pretty awesome tutorials on game programming, OpenGL, Shaders, game related maths and heaps more. Check it out!</p>
<p><a href="http://www.swiftless.com/"><img class="alignnone" title="Swiftless" src="http://www.swiftless.com/swiftlessbutton.jpg" alt="Swiftless" width="88" height="31" /></a><br />
<a href="http://www.swiftless.com">http://www.swiftless.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.20papercups.net/random-news/shameless-plug-swiftless-game-programming-tutorials/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Australia vs. The Gaming Industry</title>
		<link>http://www.20papercups.net/random-news/australia-vs-the-gaming-industry/</link>
		<comments>http://www.20papercups.net/random-news/australia-vs-the-gaming-industry/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 03:17:44 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Random News]]></category>

		<guid isPermaLink="false">http://www.20papercups.net/?p=266</guid>
		<description><![CDATA[In another blunder, the Office of Film and Literature Classification has refused to classify Alien vs. Predator, effectively banning it from sale in Australia. This comes just a month or so after Left 4 Dead 2 was refused classification, then heavily censored to meet the requirements of an MA15+ rating, what some are calling &#8220;the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.20papercups.net/wp-content/uploads/2009/12/r18-logo.jpg"><img class="alignleft size-full wp-image-269" title="r18 logo" src="http://www.20papercups.net/wp-content/uploads/2009/12/r18-logo.jpg" alt="r18 logo" width="196" height="161" /></a>In another blunder, the Office of Film and Literature Classification has refused to classify Alien vs. Predator, effectively banning it from sale in Australia. This comes just a month or so after Left 4 Dead 2 was refused classification, then heavily censored to meet the requirements of an MA15+ rating, what <a href="http://au.xbox360.ign.com/articles/104/1047522p1.html">some </a>are calling &#8220;the most disturbing censorship result in Australia&#8217;s history&#8221;. Normally, this website is a place to show off my work, and I hear some of you enjoy watching my tutorials. However, I just find this situation ridiculous, and urge everyone in Australia to do something about this.<span id="more-266"></span></p>
<p>So what is the problem? Well, Australia only has an MA15+ rating for games. Therefore, any game that doesn&#8217;t fit into this banner is refused classification and not allowed to be sold. However, the average age of Australian gamers is 30. In a fumbled attempt to <em>protect the children</em>, the adult majority get treated like immature social misfits. I have no problem with refusing to sell children games that are specifically made for adults. My problem is with treating adults like children.</p>
<p>What can we do about this? You contact the people responsible and give them a piece of your mind. The states&#8217; Attorneys General are responsible for holding back an R18+ rating for games. SA Attorney General Michael Atkinson has been the most vocal in his opposition. I urge everyone to write to their respective MP and share your thoughts on the issue. Below is my letter to Atkinson.</p>
<blockquote><p>Dear Mr Atkinson</p>
<p>My name is Michael  and I am a 24 year old PhD Candidate at the University of South Australia. I am writing to express my disgust at the current rating scheme for video games in Australia. As a country with a rich new media industry, I cannot believe we are falling behind the rest of the world with our lack of an R18+ rating for video games. Recent incidents, such as the censored release of Left 4 Dead 2 (news.com.au, 17/9/09), and the refused classification of Alien vs Predator (news.com.au, 7/12/09) has shown how out of touch Australia is.</p>
<p>The video games industry is no longer a niche market. The Entertainment Software Association states that in the US alone, video games are an 11.7 billion dollar industry. The video game Halo 3 recorded $170 million in sales on its first day, compared to $151 million for the film Spiderman 3 on its opening weekend (esa.com).</p>
<p>Furthermore, it is clear that the Australian public wants an R18+ rating for games. According to the Interactive Australia 2009 report (igea.net), the average gamer in Australia is 30 years old. Gaming is no longer an activity for children, and it is important for video games to be treated in the same way as all other mass media the Australian adult public has access to. The report also stated 91% of adults, both gamers and non‐gamers, believe Australia should have an R18+ rating for games.</p>
<p>Protecting the Children is a poor argument. 92% of Australian parents say they are aware of the games being played in their home. Purchasing games should not be considered any different to purchasing an R rated DVD. I agree that there are some games that children should not have access to. However, censorship is not the way to solve the problem. Children are not allowed to purchase alcohol, cigarettes, R rated movies, etc., retailers and parents can be responsible for enforcing the same restrictions for video games.</p>
<p>I look forward to hearing your opinion on this matter. The video games industry is large and growing, and games are an important recreational activity for many Australian adults. Australia can not afford to keep falling behind the rest of the world any more. Thank you for your time.</p>
<p>Yours faithfully</p>
<p>Michael</p></blockquote>
<p>Now if everyone would do the same, Australia can catch up with the rest of the world.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.20papercups.net/random-news/australia-vs-the-gaming-industry/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Publications updated, with video!</title>
		<link>http://www.20papercups.net/random-news/publications-updated-with-video/</link>
		<comments>http://www.20papercups.net/random-news/publications-updated-with-video/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 09:30:57 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Random News]]></category>

		<guid isPermaLink="false">http://www.20papercups.net/?p=253</guid>
		<description><![CDATA[Hey Everyone Just a quick note to say I&#8217;ve updated my publications list to include ISMAR 2009 and ACE 2009. Below is a video for my ISMAR poster. Enjoy!]]></description>
			<content:encoded><![CDATA[<p>Hey Everyone</p>
<p>Just a quick note to say I&#8217;ve updated my publications list to include ISMAR 2009 and ACE 2009. Below is a video for my ISMAR poster.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/0bilGEwQgPo&amp;hl=en&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/0bilGEwQgPo&amp;hl=en&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.20papercups.net/random-news/publications-updated-with-video/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial: The Age Gauge &amp; the easy way to get data into Flash</title>
		<link>http://www.20papercups.net/tutorials/tutorial-age-gauge/</link>
		<comments>http://www.20papercups.net/tutorials/tutorial-age-gauge/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 11:37:44 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flashvars]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[www]]></category>

		<guid isPermaLink="false">http://www.20papercups.net/?p=203</guid>
		<description><![CDATA[If you work with websites, sooner or later you will find yourself interacting with Flash. While Flash usually gives me the urge to run for the hills, sometimes it really is the correct tool for the job. If you do have to work with Flash, chances are you will need to get data into it. [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_205" class="wp-caption alignleft" style="width: 184px"><img class="size-full wp-image-205" title="Age Gauge" src="http://www.20papercups.net/wp-content/uploads/2009/06/Screenshot-Come-Out-2009-Mozilla-Firefox.png" alt="Age Gauge on Comeout.on.net" width="174" height="59" /><p class="wp-caption-text">Age Gauge on Comeout.on.net</p></div>
<p>If you work with websites, sooner or later you will find yourself interacting with Flash. While Flash usually gives me the urge to run for the hills, sometimes it really is the correct tool for the job. If you do have to work with Flash, chances are you will need to get data into it. This post documents how I created the Age Gauge for the <a href="http://comeout.on.net" target="_blank">Come Out Festival</a>&#8216;s 2009 website.<span id="more-203"></span></p>
<p style="text-align: center;"></p>
<p>Before we begin, a disclaimer: I hate working with Flash. If you are in a position where you are about to do something in Flash, the correct approach is to first make sure there is no other way to do what you want. Since I primarily work on Linux, I especially hate Flash. However, sometimes it is the best way to solve a problem.</p>
<p>Normally, if you&#8217;re using Flash for anything other than simple animation, you will need a way to pass data from your website/database/server to the Flash file. There are many ways to go about this. The Web 2.0 guys will tell you that once the Flash animation has started, it should retrieve an XML file from the server, using Flash&#8217;s built in XML parsing functionality to extract the data. A slightly more old school variation on this approach is to create a server side script that creates output looking just like URL encoded variables ($_GET in PHP). The Flash file loads the URL and the variables are automatically available as global variables. However, sometimes you just need to keep things simple. But first, some background&#8230;</p>
<h3>What is this Age Gauge anyway?</h3>
<p>Come Out is an arts festival for young people. The festival organisers needed the new website to show the target ages for all of the shows, so that 17 year old year 12s didn&#8217;t end up at a show aimed at kindergarten kids. The guys at <a href="http://www.loudwhisper.com.au" target="_blank">Loud Whisper</a> being all awesome and designy, came up with what you see above. They gave this to me and said &#8220;make it work&#8221;.</p>
<p>Now I was left with a predicament, how would I make it work? There are 171 possible combinations of ages, so making some static images is probably not the best way to go.</p>
<p>My immediate reaction was to look at the <a href="http://au.php.net/manual/en/book.image.php" target="_blank">GD image library</a> for PHP and see if I could make something work. I have made bar graphs using GD before. However, the big problem here was that it had to look like the design. The round ends were are a particular problem here. Next I thought about Javascript. To be honest, with enough CSS trickery you could probably make it work. However, I am not quite Web 2.0 enough, and getting it to be cross-browser compatible would be a bit of a pain.</p>
<p>This leaves one extra option: Implement the thing in Flash.</p>
<h3>Setting up the FLA file</h3>
<p>The fact that I don&#8217;t like Flash actually worked in my favour. I wanted to get this over and done with as quickly as possible. So, I have ignored pretty much all the cool ActionScript 3 features, and using external .as files for scripts. For something this quick and simple, it just isn&#8217;t needed.</p>
<p>So we end up with something that looks like what you see below:</p>
<div id="attachment_206" class="wp-caption aligncenter" style="width: 550px"><img class="size-full wp-image-206" title="Age Gauge Layers" src="http://www.20papercups.net/wp-content/uploads/2009/06/flash.png" alt="The Age Gauge in Flash" width="540" height="431" /><p class="wp-caption-text">The Age Gauge in Flash</p></div>
<p style="text-align: left;">All of the layers can be ignored except for <em>red</em>. Red contains the red bar that moves and changes size. Because we need to change the red bar using ActionScript, we&#8217;ve given the red movie clip an instance name called <em>slider</em>. Where the slider is actually positioned doesn&#8217;t matter too much, because we&#8217;re going to be moving it once the movie loads anyway!</p>
<h3 style="text-align: left;">ActionScript me baby!</h3>
<p>Before we can do anything, we need to figure out the correct position for the slider, and the correct increment for a single year. The way I did this was to simply move the slider using the arrow keys on the keyboard until I had something that looked right. We then put these into script:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;">var startAge<span style="color: #008080;">;</span>
var endAge<span style="color: #008080;">;</span>
&nbsp;
<span style="color: #ff0000; font-style: italic;">/**
 * This is the smallest value for the start age
 */</span>
var MIN_POSITION <span style="color: #000080;">=</span> <span style="color:#800080;">2.9</span><span style="color: #008080;">;</span>
&nbsp;
<span style="color: #ff0000; font-style: italic;">/**
 * The width of a single year.
 * So, if there were 2 years between the start and end age,
 * The width of the rectangle would be step*2
 */</span>
var STEP <span style="color: #000080;">=</span> <span style="color:#800080;">9.29</span></pre></div></div>

<p>So, with an age of 0, the slider should have it&#8217;s position.x at 2.9. For every year, we had 9.29 onto this position. Sounds easy so far right? Next we have to actually do the moving and resizing based on the starting and ending age:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #666666;">// set the position of the slider, but first</span>
<span style="color: #666666;">// we don't want things to break with a negative age</span>
<span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>startAge <span style="color: #000040;">&amp;</span>lt<span style="color: #008080;">;</span><span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
 startAge <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
 slider._x <span style="color: #000080;">=</span> MIN_POSITION<span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span>
<span style="color: #0000ff;">else</span> <span style="color: #008000;">&#123;</span>
 <span style="color: #666666;">// here we take the position, and add the step value multiplied by the start age</span>
 slider._x <span style="color: #000080;">=</span> MIN_POSITION <span style="color: #000040;">+</span> <span style="color: #008000;">&#40;</span>startAge <span style="color: #000040;">*</span> STEP<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #666666;">// now we just set the width to be however many years are between the start and end ages</span>
slider._width <span style="color: #000080;">=</span> STEP<span style="color: #000040;">*</span><span style="color: #008000;">&#40;</span>endAge<span style="color: #000040;">-</span>startAge<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></pre></div></div>

<p>That is all of the code to make this work. We don&#8217;t even need to be too precise with the starting position and step, because the mask hides it if we are slightly off. This is one of the benefits of using Flash, and made the Age Gauge very easy to implement.</p>
<h3>Getting the data into Flash</h3>
<p>The next step is to actually make this work. The script above uses uninitialised variables. This will cause things to break, which would be bad. We need to get data into the swf file so that startAge and endAge have values. As I mentioned way back at the start, there are a few ways this can be done. The one I didn&#8217;t mention is to simply use flashvars in the HTML of the page. This gives the Flash file data without having to bother with opening remote URLs for use with XML parsing or loadVars(). <strong>This is not the best way for all problems!</strong> However, all we are trying to do here is get two numbers in, so what&#8217;s the big deal?</p>
<p>Creating the HTML is pretty straight forward. I should mention though that I use swfobject for loading Flash through Javascript. It gets around some issues, such as IE7 not playing Flash on page load. Anyway, the HTML looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="js" style="font-family:monospace;">&lt;script type=&quot;text/javascript&quot;&gt;
swfobject.embedSWF(&quot;AgeGauge.swf&quot;, 
                   &quot;AgeGauge&quot;,
                   &quot;168&quot;, 
                   &quot;61&quot;, 
                   &quot;9.0.0&quot;,
                   false,
		   {startAge: &quot;6&quot;, endAge: &quot;13&quot;}
                  );
&lt;/script&gt;</pre></div></div>

<p>The code above uses swf object to load the Age Gauge, passing flashvars to the file when it loads. In this example, we are using a start age of 16, and end age of 13. If you aren&#8217;t using flashvars, then you&#8217;d do something more like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;object id=&quot;AgeGauge&quot; data=&quot;AgeGauge.swf&quot; type=&quot;application/x-shockwave-flash&quot;  height=&quot;61&quot; width=&quot;168&quot;&gt;
   &lt;param value=&quot;startAge=6&amp;amp;amp;endAge=13&quot; name=&quot;flashvars&quot;&gt;
&lt;/object&gt;</pre></div></div>

<p>The point is the same. Really, all swfobject does is generate this HTML for you when the page loads. Note that the flashvars param has the actual startAge and endAge variables formatted like $_GET data, in the same format as loadVars() expects.</p>
<h3>Conclusion</h3>
<p>And that&#8217;s all there is to it really. Remember that using flashvars is a very simple way of getting data from your website into Flash. For more complicated things, parsing an XML file would be a much more flexible way to go. The moral of the story is to use the right tool for the job. Whether we are talking about the choice of Flash, GD, or Javascript, or choosing between the methods of getting data into Flash.  Hope this was at least a little useful!</p>
<p style="text-align: center;"></p>
]]></content:encoded>
			<wfw:commentRss>http://www.20papercups.net/tutorials/tutorial-age-gauge/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Projects now up</title>
		<link>http://www.20papercups.net/random-news/web-projects-now-up/</link>
		<comments>http://www.20papercups.net/random-news/web-projects-now-up/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 03:44:43 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Random News]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[portfolio]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.20papercups.net/?p=191</guid>
		<description><![CDATA[Just a quick note to say that there are now projects in this online portfolio! http://www.20papercups.net/projects/web-development Now you can see some of the work I&#8217;ve actually done. I hope to have 3D and PhD related work up soon. Cheers, Michael]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-12" title="fonzie" src="http://www.20papercups.net/wp-content/uploads/2008/12/fonzie.jpeg" alt="fonzie" width="120" height="120" />Just a quick note to say that there are now projects in this online portfolio!</p>
<p><a href="http://www.20papercups.net/projects/web-development/" target="_self">http://www.20papercups.net/projects/web-development</a></p>
<p>Now you can see some of the work I&#8217;ve actually done. I hope to have 3D and PhD related work up soon.</p>
<p>Cheers, Michael</p>
]]></content:encoded>
			<wfw:commentRss>http://www.20papercups.net/random-news/web-projects-now-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Videos! Learn how to use Git</title>
		<link>http://www.20papercups.net/random-news/new-git-videos-learn-how-to-use-git/</link>
		<comments>http://www.20papercups.net/random-news/new-git-videos-learn-how-to-use-git/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 08:44:09 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Git Video Tutorials]]></category>
		<category><![CDATA[Random News]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[vtm]]></category>

		<guid isPermaLink="false">http://www.20papercups.net/?p=168</guid>
		<description><![CDATA[Hello everyone! So this afternoon I was bored. Then I thought I would be somewhat productive and make some videos. I didn&#8217;t have anything prepared for making programming ones. However, I had a couple of people ask me about Git and why I thought it was so freaking great. So, today I offer you 3 [...]]]></description>
			<content:encoded><![CDATA[<p>Hello everyone!</p>
<p>So this afternoon I was bored. Then I thought I would be somewhat productive and make some videos. I didn&#8217;t have anything prepared for making programming ones. However, I had a couple of people ask me about Git and why I thought it was so freaking great. So, today I offer you 3 new videos, giving a basic overview of the Git Source Code Management System. Here are the videos so far:</p>
<p><span id="more-168"></span><br />
<a href="http://www.20papercups.net/tutorials/git-vtm01-what-is-git/" target="_self">VTM01 &#8211; What is Git?</a><br />
<a href="http://www.20papercups.net/tutorials/git-vtm02-the-basics/" target="_self">VTM02 &#8211; The Basics of Git</a><a href="http://www.20papercups.net/tutorials/git-vtm03-pushing-pulling/" target="_self"><br />
VTM03 &#8211; Pushing and Pulling</a></p>
<p>Thats all for now. If anyone has any thoughts on what topics should be covered, let me know. Git is huge, and I can&#8217;t cover all of the features in great detail. And remember kids, if all else fails:</p>
<pre>man git</pre>
<p>Cheers<br />
Michael</p>
]]></content:encoded>
			<wfw:commentRss>http://www.20papercups.net/random-news/new-git-videos-learn-how-to-use-git/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Git Tutorial 03 &#8211; Pushing &amp; Pulling</title>
		<link>http://www.20papercups.net/tutorials/git-vtm03-pushing-pulling/</link>
		<comments>http://www.20papercups.net/tutorials/git-vtm03-pushing-pulling/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 09:06:51 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Git Video Tutorials]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.20papercups.net/?p=174</guid>
		<description><![CDATA[In the last video, we just looked at adding files and commiting changes. This is great, but remember that in Git, commits are local. In this video we look at how we can set up remote repositories that we can push data to, either to use as backups, or for sharing with others. Note that [...]]]></description>
			<content:encoded><![CDATA[<p>In the last video, we just looked at adding files and commiting changes. This is great, but remember that in Git, commits are local. In this video we look at how we can set up remote repositories that we can push data to, either to use as backups, or for sharing with others.<span id="more-174"></span></p>
<p style="text-align: center;"><img src="http://www.20papercups.net/wp-content/plugins/flash-video-player/default_video_player.gif" /></p>
<p style="text-align: left;">Note that this video is 640&#215;480, so hit the full screen button to get more readable detail.</p>
<p style="text-align: center;"></p>
<p style="text-align: left;"><strong>Notes</strong></p>
<p style="text-align: left;">I cannot believe I messed up the remote path that many times! I am sorry about that. Of course, the side effect is you learnt how to both add and remove remotes. So yeah&#8230; I did that on purpose.</p>
<p style="text-align: left;">At this point, we can create a project or join an existing one. We can add files and commit changes. We can push our changes to remotes, and fetch changes that other people have made. This is all great. However, we haven&#8217;t touched on one of Git&#8217;s most powerful features. I am of course talking about branching and merging. This will be the priority for the next video.</p>
<p style="text-align: left;">Again, any feedback is much appreciated.</p>
<p style="text-align: left;">
]]></content:encoded>
			<wfw:commentRss>http://www.20papercups.net/tutorials/git-vtm03-pushing-pulling/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Git Tutorial 02 &#8211; The basics</title>
		<link>http://www.20papercups.net/tutorials/git-vtm02-the-basics/</link>
		<comments>http://www.20papercups.net/tutorials/git-vtm02-the-basics/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 08:59:45 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Git Video Tutorials]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[vtm]]></category>

		<guid isPermaLink="false">http://www.20papercups.net/?p=172</guid>
		<description><![CDATA[This video hits up the terminal and starts using git. We start by creating a git repository, which is super easy with Git. Then, we look at adding files to the repository, and commiting changes. Note that this video is 640&#215;480, so hit the full screen button to get more readable detail. Notes In this [...]]]></description>
			<content:encoded><![CDATA[<p>This video hits up the terminal and starts using git. We start by creating a git repository, which is super easy with Git. Then, we look at adding files to the repository, and commiting changes. <span id="more-172"></span></p>
<p style="text-align: center;"><img src="http://www.20papercups.net/wp-content/plugins/flash-video-player/default_video_player.gif" /></p>
<p style="text-align: left;">Note that this video is 640&#215;480, so hit the full screen button to get more readable detail.</p>
<p style="text-align: center;"></p>
<p style="text-align: left;"><strong>Notes</strong></p>
<p style="text-align: left;">In this video, I specifically create a project using:</p>
<pre>git init</pre>
<p>. If you are working on your own projects, this is how you will work. However, a lot of the time you will be starting work on an already existing project. In this case, you don&#8217;t create a new repo using git init, instead you <em>clone</em> an already existing repository. The basic is this:</p>
<pre>git clone path/to/repository</pre>
<p>I will cover this in a later video, but I think it is important enough to mention here.</p>
<p>Another thing that I could have covered in more detail is the staging area. There is actually a lot more that you can do with it than I mentioned in this video. However, that will come later. For the first 3 videos (at least) I want to just get the basics down.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.20papercups.net/tutorials/git-vtm02-the-basics/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
