<?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>Atanas Roussev - Senior Java Developer, UI Engineer, Web Developer Resume - Vancouver</title>
	<atom:link href="http://www.roussev.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.roussev.org</link>
	<description>a Web Developer creating elegant aesthetic software</description>
	<lastBuildDate>Mon, 31 May 2010 22:07:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Science of motivation. Fascinating animation.</title>
		<link>http://www.roussev.org/2010/05/science-of-motivation-a-drawn-fascinating-video/</link>
		<comments>http://www.roussev.org/2010/05/science-of-motivation-a-drawn-fascinating-video/#comments</comments>
		<pubDate>Mon, 31 May 2010 22:03:31 +0000</pubDate>
		<dc:creator>atanas</dc:creator>
				<category><![CDATA[Fun]]></category>

		<guid isPermaLink="false">http://www.roussev.org/?p=1021</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="500" height="300" 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/u6XAPnuFjJc&amp;hl=en_US&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="500" height="300" src="http://www.youtube.com/v/u6XAPnuFjJc&amp;hl=en_US&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.roussev.org/2010/05/science-of-motivation-a-drawn-fascinating-video/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>a 3D feel</title>
		<link>http://www.roussev.org/2010/05/a-3d-feel/</link>
		<comments>http://www.roussev.org/2010/05/a-3d-feel/#comments</comments>
		<pubDate>Mon, 03 May 2010 02:49:23 +0000</pubDate>
		<dc:creator>atanas</dc:creator>
				<category><![CDATA[REST Client]]></category>

		<guid isPermaLink="false">http://www.roussev.org/?p=1018</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.roussev.org/blog/wp-content/uploads/2010/05/3d.jpg"><img class="alignnone size-full wp-image-1019" title="3d" src="http://www.roussev.org/blog/wp-content/uploads/2010/05/3d.jpg" alt="" width="600" height="712" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.roussev.org/2010/05/a-3d-feel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reinventing desktop human-computer interaction and the future of tablets</title>
		<link>http://www.roussev.org/2010/04/multitouch-desktop-human-computer-interaction/</link>
		<comments>http://www.roussev.org/2010/04/multitouch-desktop-human-computer-interaction/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 17:51:42 +0000</pubDate>
		<dc:creator>atanas</dc:creator>
				<category><![CDATA[Tablet, iPad]]></category>
		<category><![CDATA[mouse gestures]]></category>
		<category><![CDATA[multitouch]]></category>

		<guid isPermaLink="false">http://www.roussev.org/?p=1008</guid>
		<description><![CDATA[An interesting approach reinventing desktop human-computer interaction from http://10gui.com/video/

And very inspiring article from UXMag:
http://www.uxmag.com/technology/toward-a-better-tablet-os-part-2
]]></description>
			<content:encoded><![CDATA[<p>An interesting approach reinventing desktop human-computer interaction from <a href="http://10gui.com/video/">http://10gui.com/video/</a></p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="500" height="280" 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://vimeo.com/moogaloop.swf?clip_id=6712657&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="500" height="280" src="http://vimeo.com/moogaloop.swf?clip_id=6712657&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>And very inspiring article from UXMag:</p>
<p><a href="http://www.uxmag.com/technology/toward-a-better-tablet-os-part-2">http://www.uxmag.com/technology/toward-a-better-tablet-os-part-2</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.roussev.org/2010/04/multitouch-desktop-human-computer-interaction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML 5 &#8211; Bad days for Flash</title>
		<link>http://www.roussev.org/2010/04/html-5-canvas-gwt-flash/</link>
		<comments>http://www.roussev.org/2010/04/html-5-canvas-gwt-flash/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 18:17:27 +0000</pubDate>
		<dc:creator>atanas</dc:creator>
				<category><![CDATA[GWT]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://www.roussev.org/?p=996</guid>
		<description><![CDATA[Just found another great example of HTML 5.
http://code.google.com/p/quake2-gwt-port/
Those guys have  ported Quake via GWT to pure HTML and JavaScript. I am pretty sure it will behave well only on WebKit, yet it shows the new approach the web is going, &#8220;sadly&#8221; without Adobe Flash.

]]></description>
			<content:encoded><![CDATA[<p>Just found another great example of HTML 5.</p>
<p><a href="http://code.google.com/p/quake2-gwt-port/">http://code.google.com/p/quake2-gwt-port/</a></p>
<p>Those guys have  ported Quake via GWT to pure HTML and JavaScript. I am pretty sure it will behave well only on WebKit, yet it shows the new approach the web is going, &#8220;sadly&#8221; without Adobe Flash.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="440" height="305" 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/XhMN0wlITLk&amp;rel=0&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;hl=en_US&amp;feature=player_embedded&amp;fs=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="440" height="305" src="http://www.youtube.com/v/XhMN0wlITLk&amp;rel=0&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;hl=en_US&amp;feature=player_embedded&amp;fs=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.roussev.org/2010/04/html-5-canvas-gwt-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>REST client HTTP4e version 3 released &#8211; code generation for Ruby, C#, Flex, ActionScript, jQuery, Java, Prototype, Cocoa</title>
		<link>http://www.roussev.org/2010/03/rest-client-http4e-version-3-released-code-generation-for-ruby-c-flex-actionscript-jquery-java-prototype-cocoa/</link>
		<comments>http://www.roussev.org/2010/03/rest-client-http4e-version-3-released-code-generation-for-ruby-c-flex-actionscript-jquery-java-prototype-cocoa/#comments</comments>
		<pubDate>Sat, 27 Mar 2010 07:13:29 +0000</pubDate>
		<dc:creator>atanas</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[GWT]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[REST Client]]></category>

		<guid isPermaLink="false">http://www.roussev.org/?p=991</guid>
		<description><![CDATA[Great news. HTTP4e was released few weeks ago. Today I found some time to post it.
New features:


Introducing @file abilities to load external payload to body by simply passing @/file/path
Export HTTP sessions report as HTML
Export and import HTTP4e replay script
Importing raw HTTP packets
Importing http packets directly from Firefox’s Live HTTPHeaders
Enhancing tabs
Fixing Pretty view XML formatting
JMeterone click [...]]]></description>
			<content:encoded><![CDATA[<p>Great news. HTTP4e was released few weeks ago. Today I found some time to post it.</p>
<p>New features:</p>
<div id="_mcePaste">
<ul>
<li>Introducing @file abilities to load external payload to body by simply passing @/file/path</li>
<li>Export HTTP sessions report as HTML</li>
<li>Export and import HTTP4e replay script</li>
<li>Importing raw HTTP packets</li>
<li>Importing http packets directly from Firefox’s Live HTTPHeaders</li>
<li>Enhancing tabs</li>
<li>Fixing Pretty view XML formatting</li>
<li>JMeterone click script generation</li>
<li>PHP, Flex/ActionScript, Cocoa/Objective-C, Ruby, Pythonone click script generation</li>
<li>C#, Visual Basic.NETone click script generation</li>
<li>JavaScript, Prototype, jQuery one click script generation</li>
<li>Apache HTTP Components 4.x one click code generation</li>
</ul>
</div>
<p>Stay tuned for more news and examples.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.roussev.org/2010/03/rest-client-http4e-version-3-released-code-generation-for-ruby-c-flex-actionscript-jquery-java-prototype-cocoa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beautiful GWT animation libraries</title>
		<link>http://www.roussev.org/2010/03/beautiful-gwt-animation-libraries/</link>
		<comments>http://www.roussev.org/2010/03/beautiful-gwt-animation-libraries/#comments</comments>
		<pubDate>Sat, 27 Mar 2010 07:09:06 +0000</pubDate>
		<dc:creator>atanas</dc:creator>
				<category><![CDATA[GWT]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.roussev.org/?p=988</guid>
		<description><![CDATA[Probably many of you needed to add Mootools, jQuery or Scriptaculous kinda effects within your GWT code.
I came across those two and I am spreading them to web:
Brand new, dead-easy to use library called GWT-FX:
http://code.google.com/p/gwt-fx/
A GWT wrapper over Mootools:
http://www.amateurinmotion.com/projects/gwt-mootools.html
]]></description>
			<content:encoded><![CDATA[<p>Probably many of you needed to add Mootools, jQuery or Scriptaculous kinda effects within your GWT code.</p>
<p>I came across those two and I am spreading them to web:</p>
<p>Brand new, dead-easy to use library called GWT-FX:<br />
<a href="http://code.google.com/p/gwt-fx/">http://code.google.com/p/gwt-fx/</a></p>
<p>A GWT wrapper over Mootools:<br />
<a href="http://www.amateurinmotion.com/projects/gwt-mootools.html">http://www.amateurinmotion.com/projects/gwt-mootools.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.roussev.org/2010/03/beautiful-gwt-animation-libraries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Velocity ResourceNotFoundException Hell</title>
		<link>http://www.roussev.org/2010/03/the-velocity-resourcenotfoundexception-hell/</link>
		<comments>http://www.roussev.org/2010/03/the-velocity-resourcenotfoundexception-hell/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 06:28:44 +0000</pubDate>
		<dc:creator>atanas</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.roussev.org/?p=978</guid>
		<description><![CDATA[Every now and then I need to use the Velocity templating. And the first thing I always experience is that nasty failure.
SEVERE: ResourceManager : unable to find resource 'template.vm'
 in any resource loader.
Exception in thread "main"
org.apache.velocity.exception.ResourceNotFoundException:
 Unable to find resource 'template.vm'
...
Velocity is so picky and always complains about the .VM template not being found. And [...]]]></description>
			<content:encoded><![CDATA[<p>Every now and then I need to use the Velocity templating. And the first thing I always experience is that nasty failure.</p>
<pre style="background: none repeat scroll 0% 0% #ececda; padding: 10px;"><span style="color: #993300;">SEVERE: ResourceManager : unable to find resource 'template.vm'
 in any resource loader.
Exception in thread "main"
org.apache.velocity.exception.<strong>ResourceNotFoundException</strong>:
 Unable to find resource 'template.vm'
...</span></pre>
<p>Velocity is so picky and always complains about the .VM template not being found. And I always start fiddling around, making sure file name is correct, making sure the VM file is right file location, class path location and yet same cruel error ResourceNotFoundException&#8230;</p>
<p>The answer for &#8220;properly&#8221; configuring Velocity and making it happy is bellow:</p>
<pre style="background: none repeat scroll 0% 0% #ececda; padding: 10px;"><span style="color: #993300;">Properties p = new Properties();

<span style="color: #008000;"><strong>// Uncomment if template.vm is being loaded from file system</strong>
//p.setProperty( <span style="color: #ff0000;">"resource.loader"</span>, <span style="color: #ff0000;">"file"</span> );
// absolute or relative path
//p.setProperty( <span style="color: #ff0000;">"file.resource.loader.path"</span>, <span style="color: #ff0000;">"./src"</span> );
//p.setProperty( <span style="color: #ff0000;">"file.resource.loader.class"</span>,
   <span style="color: #ff0000;">"org.apache.velocity.runtime.resource.loader.FileResourceLoader"</span> );</span>

<span style="color: #008000;"><strong>// Uncomment if "template.vm" is being loaded from class path, jar, zip,..</strong>
//p.setProperty( <span style="color: #ff0000;">"</span><span style="color: #ff0000;">resource.loader</span><span style="color: #ff0000;">"</span>, <span style="color: #ff0000;">"</span><span style="color: #ff0000;">class</span><span style="color: #ff0000;">"</span> );
//p.setProperty( <span style="color: #ff0000;">"</span><span style="color: #ff0000;">class.resource.loader.class</span><span style="color: #ff0000;">"</span>,
  <span style="color: #ff0000;">"org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"</span> );</span>

VelocityEngine ve = new VelocityEngine();
<span style="color: #ff0000;">ve.init(p);</span>
Template t = ve.getTemplate("template.vm");
</span></pre>
<p>All said, I am not sure why Velocity team designed it in such a strict way. Instead the engine should be smart enough to find the template directly from Class path location or File resource. Why so difficult?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.roussev.org/2010/03/the-velocity-resourcenotfoundexception-hell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTTP4e REST Client on MyRadRails Ruby IDE</title>
		<link>http://www.roussev.org/2010/03/http4e-rest-client-on-myradrails-ruby-ide/</link>
		<comments>http://www.roussev.org/2010/03/http4e-rest-client-on-myradrails-ruby-ide/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 02:56:21 +0000</pubDate>
		<dc:creator>atanas</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[REST Client]]></category>
		<category><![CDATA[Ruby, Scala, Groovy]]></category>

		<guid isPermaLink="false">http://www.roussev.org/?p=970</guid>
		<description><![CDATA[I was playing with Ruby and tried HTTP4e on MyRadRails and it worked as a charm.
This is what I call write once run anywhere. Great job Eclipse!

]]></description>
			<content:encoded><![CDATA[<p>I was playing with Ruby and tried HTTP4e on MyRadRails and it worked as a charm.</p>
<p>This is what I call write once run anywhere. Great job Eclipse!</p>
<p><a href="http://www.roussev.org/blog/wp-content/uploads/2010/03/MyRadRails-Ruby-REST-Client.png"><img class="alignnone size-full wp-image-974" title="MyRadRails-RESTClient-2" src="http://www.roussev.org/blog/wp-content/uploads/2010/03/MyRadRails-RESTClient-2.png" alt="Ruby REST Client" width="470" height="473" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.roussev.org/2010/03/http4e-rest-client-on-myradrails-ruby-ide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automating HTML Selenium IDE tests to Java JUnit</title>
		<link>http://www.roussev.org/2010/03/webdriver-automating-selenium-ide-html-test-by-transforming-java-junit/</link>
		<comments>http://www.roussev.org/2010/03/webdriver-automating-selenium-ide-html-test-by-transforming-java-junit/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 01:43:45 +0000</pubDate>
		<dc:creator>atanas</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Selenium WebDriver]]></category>

		<guid isPermaLink="false">http://www.roussev.org/?p=951</guid>
		<description><![CDATA[One year ago I was involved with Selenium as part of a web automated testing project. I discovered multiple limitations with the Selenium framework, mainly with its integration with existing CruiseControl architecture. Having some time lately, I explored the idea of Selenium4j, a framework translating Selenium HTML scripts to Java Junit tests. I hosted to project [...]]]></description>
			<content:encoded><![CDATA[<p>One year ago I was involved with Selenium as part of a web automated testing project. I discovered multiple limitations with the Selenium framework, mainly with its integration with existing CruiseControl architecture. Having some time lately, I explored the idea of <a title="WebDriver Selenium IDE HTML to java junit " href="http://code.google.com/p/selenium4j/" target="_blank">Selenium4j</a>, a framework translating Selenium HTML scripts to Java Junit tests. I hosted to project at</p>
<p><a href="http://code.google.com/p/selenium4j/">http://code.google.com/p/selenium4j/</a></p>
<h2>Problems with Selenium IDE HTML tests</h2>
<div id="_mcePaste">
<ul>
<li>While Selenium IDE is great tool for creating HTML tests, the HTML scripts are not Java tests and as such are not usable outside of the Selenium IDE environment</li>
<li>Using the IDE to create the Java JUnit test works one way only &#8211; from HTML to Java. Re-using the java test within Selenium IDE proved to be unreliable and buggy</li>
<li>Using Selenium RC to invoke the HTML files is not practical solution as it allows only a limited configuration such as browser, server and a single suite. E.g.</li>
</ul>
</div>
<pre>java -jar selenium-server.jar -multiwindow -htmlSuite "*iexplore"
"https://www.website.com" "C:\suite.html" "C:\results.html"</pre>
<h2>Motivation for Selenium4j</h2>
<div id="_mcePaste">In reality we would like to:</div>
<div id="_mcePaste">
<ul>
<li>Reuse the Selenium HTML suites for regression testing</li>
<li>To be able to integrate them within an automated environment (think CruiseControl f.i.)</li>
<li>Make the Selenium HTML tests configurable</li>
</ul>
</div>
<h2>WebDriver (Selenium2) solution?</h2>
<p>Looking into WebDriver there is no analog of the Selenium IDE. The IDE is an amazing tool for recording the user clicks and it should be great if WebDriver solve the HTML automation integration. It seems that the later version of the IDE (1.0.5 as of writing) provides better support for the new Selenium2 API. Yet, the problem with HTML test integration is still on the table. As long as you record your script and export it to HTML,  you are on your own. You need to manually use the IDE to translate the HTML scripts to the desired language (Java in my case), then you need to copy the source, paste it to you Eclipse/Netbeans, make sure compiles, configure it properly. In other words, it&#8217;s not fun.  WebDriver should provide a solution that simplifies that process and at the end the recorded Selenium IDE script should be seamlessly integrated within an automated environment. In that context, Selenium4j is an example how HTML could be easily translated to a Java JUnit sources.</p>
<h2>How does Selenium4j work?</h2>
<div id="_mcePaste">In short Selenium4j translates the HTML tests to Java JUnit tests. It iterates through the HTML suite and tests, digest them and smartly discovers their Selenium commands. Each command is being subsequently transformed to a Java JUnit method. At the end of the transformation the HTML scripts are being translated to Java JUnit sources following same directory(package) structure as the suite and tests. In addition, Selenium4j have suite setup/teardown utilities as well as external configuration.</div>
<p>
<div>Once again, for all the sources and ideas refer to <a href="http://code.google.com/p/selenium4j/">http://code.google.com/p/selenium4j/</a></div>
</p>
<p>
<div>Have fun and lazy automated web regression testing!</div></p>
]]></content:encoded>
			<wfw:commentRss>http://www.roussev.org/2010/03/webdriver-automating-selenium-ide-html-test-by-transforming-java-junit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Spirals Algorithm Applet</title>
		<link>http://www.roussev.org/2010/02/the-javaspirals-applet-algorithm/</link>
		<comments>http://www.roussev.org/2010/02/the-javaspirals-applet-algorithm/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 07:57:10 +0000</pubDate>
		<dc:creator>atanas</dc:creator>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.roussev.org/?p=939</guid>
		<description><![CDATA[Interesting. I&#8217;ve build few Mathematics Applets 10 years ago. Yet, I can still discover their links on internet. I&#8217;ve just found my Spirals Applet being featured at comPADRE &#8211; a Physics and Astronomy community site.
Applet is http://www.roussev.org/applets/spiral/spiral.html.
And the Spirals Algorithm is as simple as:
import java.applet.Applet;
import java.awt.Color;
import java.awt.Graphics;

public class HelloSpirals extends Applet {
   int max = [...]]]></description>
			<content:encoded><![CDATA[<p>Interesting. I&#8217;ve build few Mathematics Applets 10 years ago. Yet, I can still discover their links on internet. I&#8217;ve just found my Spirals Applet being featured at <a href="http://www.compadre.org/portal/items/detail.cfm?ID=8058">comPADRE &#8211; a Physics and Astronomy community site</a>.</p>
<p>Applet is <a title="Spirals Java Applet" href="http://www.roussev.org/applets/spiral/spiral.html">http://www.roussev.org/applets/spiral/spiral.html</a>.</p>
<p>And the Spirals Algorithm is as simple as:</p>
<pre style="background: none repeat scroll 0% 0% #ececda; padding: 10px;"><span style="color: #993300;">import java.applet.Applet;
import java.awt.Color;
import java.awt.Graphics;

public class <strong>HelloSpirals </strong>extends <strong>Applet </strong>{
   int max = 100;
   int centerPosition = 150;
   double angle = 22 / (double) 128;

   public void <strong>paint</strong>( Graphics g){
      setBackground(Color.black);
      g.setColor(Color.red);

      for (int i = 0; i &lt; max; i++) {
         int[] coordEnd = getCoordinates(i);
         int[] coordStart = getCoordinates(i - 1);
         g.drawLine(centerPosition + coordStart[0],
                         centerPosition + coordStart[1],
                         centerPosition + coordEnd[0],
                         centerPosition + coordEnd[1]);
      }
   }

   private double <strong>getAngle</strong>( int inx){
      return (inx - 1) * angle;
   }

   private int[] <strong>getCoordinates</strong>( int inx){
      double angle = getAngle(inx - 1);
      int x = (int) Math.round(inx * Math.cos(angle));
      int y = (int) Math.round(inx * Math.sin(angle));

      return new int[] { x, y };
   }
}
</span></pre>
<p><a href="http://www.roussev.org/blog/wp-content/uploads/2010/02/spirals-algorithm-java-applet.jpg"><img class="alignnone size-full wp-image-948" title="spirals-algorithm-java-applet" src="http://www.roussev.org/blog/wp-content/uploads/2010/02/spirals-algorithm-java-applet.jpg" alt="" width="274" height="219" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.roussev.org/2010/02/the-javaspirals-applet-algorithm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
