<?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>armisael.silix.org</title>
	<atom:link href="http://armisael.silix.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://armisael.silix.org</link>
	<description>Armisael's scientific world</description>
	<lastBuildDate>Thu, 01 Apr 2010 10:49:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to compile iPhone 3.1.3 applications with Xcode 3.2.1 without Provisioning Profile</title>
		<link>http://armisael.silix.org/2010/04/how-to-compile-iphone-3-1-3-applications-with-xcode-3-2-1-without-provisioning-profile/</link>
		<comments>http://armisael.silix.org/2010/04/how-to-compile-iphone-3-1-3-applications-with-xcode-3-2-1-without-provisioning-profile/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 10:27:24 +0000</pubDate>
		<dc:creator>Armisael</dc:creator>
				<category><![CDATA[Senza categoria]]></category>
		<category><![CDATA[iPhone 3.1.3]]></category>
		<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[Xcode 3.2.1]]></category>

		<guid isPermaLink="false">http://armisael.silix.org/?p=81</guid>
		<description><![CDATA[Some days ago I started to develop an iPhone application with the latest version of Xcode. When I realized that I need to pay 99 dollars to Apple in order to test my application (that, by the way, I would share freely), I started to search on the web a solution for this problem. Unfortunately [...]]]></description>
			<content:encoded><![CDATA[<p>Some days ago I started to develop an iPhone application with the latest version of Xcode. When I realized that I need to pay 99 dollars to Apple in order to test my application (that, by the way, I would share freely), I started to search on the web a solution for this problem. Unfortunately all the proposed solutions where about iPhone 2.0, and these don&#8217;t work the same with iPhone 3.1.3. Today I found an how-to that worked for me, but with some passages that could be a bit tricky for non-hackers, so I decided to share it here, with some more passages needed to get our final goal: develop an iPhone application with Xcode 3.2.1 without being registered to any Apple Development Service.</p>
<p>Nothing from this page comes from me, everything was written by <strong>KennyTM</strong> on his blog: <a href="http://networkpx.blogspot.com/2009/09/compiling-iphoneos-31-apps-with-xcode.html" target="_blank">networkpx Project Blog</a> so don&#8217;t thank me &#8211; if it works &#8211; but go to his blog and visit him!</p>
<h2>Only compile the executable</h2>
<p>If you just want to compile the executable, maybe for including it in a .ipa file, or for copying it with scp on your device, just follow the instructions on KennyTM&#8217;s blog, under the &#8220;I want to compile.&#8221; title. It&#8217;s simple, clear and understandable (thanks, KennyTM!).</p>
<h2>Also install it on your device</h2>
<p>Well, this part is more tricky, but it&#8217;s not so difficult if you know how to use the Terminal (and you know how to use it, right?).</p>
<ul>
<li>The point 1 is quiet simple, just download the executable by following the link, and place it in /usr/local/bin as KennyTM said. Remember to make it executable running

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">chmod</span> +x <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ldid.</pre></div></div>

</li>
<li>The point 2 is also simple, but remember again to make it executable, as shown above.</li>
<li>Points 3 and 4 are easy.</li>
<li>In point 5, in order to copy installd from my device to my mac, I used ssh. I have it since I have a Jailbroken iPod Touch, and I have been able to install OpenSsh with Cydia; if you have an original OS on your device (good for you) check if ssh is available looking in the Preference Panel of the device which is its IP address (you need to connect it at the same network of your mac, obviously) and executing

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh</span> root<span style="color: #000000; font-weight: bold;">@</span>IP_ADDRESS</pre></div></div>

<p>from a Terminal of your mac. The default password for your device is &#8220;alpine&#8221; (remember to change it with passwd, since it&#8217;s the same for all iPhones and iPods). If it works, just run</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">scp</span> root<span style="color: #000000; font-weight: bold;">@</span>IP_ADDRESS:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>libexec<span style="color: #000000; font-weight: bold;">/</span>installd ~<span style="color: #000000; font-weight: bold;">/</span>Desktop<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>and you have copied installd on your mac.</li>
<li>Points 6 and 7 are simple, just follow them.</li>
<li>In order to complete point 8, you need to use the iPhone gcc. Looking at some comments on the blog you can find how to do this, but here it is the command you have to execute:

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>Developer<span style="color: #000000; font-weight: bold;">/</span>Platforms<span style="color: #000000; font-weight: bold;">/</span>iPhoneOS.platform<span style="color: #000000; font-weight: bold;">/</span>Developer<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gcc-<span style="color: #000000;">4.2</span> libmiss.c \
<span style="color: #660033;">-dynamiclib</span> \
-install_name <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libmiss.dylib \
-current_version <span style="color: #000000;">1</span> \
-compatibility_version <span style="color: #000000;">1</span> \
-Wl,-reexport-lmis \
-flat_namespace \
<span style="color: #660033;">-isysroot</span> <span style="color: #000000; font-weight: bold;">/</span>Developer<span style="color: #000000; font-weight: bold;">/</span>Platforms<span style="color: #000000; font-weight: bold;">/</span>iPhoneOS.platform<span style="color: #000000; font-weight: bold;">/</span>Developer<span style="color: #000000; font-weight: bold;">/</span>SDKs<span style="color: #000000; font-weight: bold;">/</span>iPhoneOS3.0.sdk \
<span style="color: #660033;">-arch</span> armv6 \
<span style="color: #660033;">-o</span> libmiss.dylib</pre></div></div>

</li>
<li>Points from 9 to 12 are simple, just use scp again to copy the modified files from your mac to your device (scp SOURCE DEST).</li>
</ul>
<p>Remember to add your device to Xcode. To do that, run it and from the menu select &#8220;Window / Organizer&#8221;. Connect your device, select it and enable it!<br />
Now you are able to compile your applications on your device! Happy working!</p>
]]></content:encoded>
			<wfw:commentRss>http://armisael.silix.org/2010/04/how-to-compile-iphone-3-1-3-applications-with-xcode-3-2-1-without-provisioning-profile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use emule collection files in mlDonkey</title>
		<link>http://armisael.silix.org/2010/03/how-to-use-emule-collection-file-in-mldonkey/</link>
		<comments>http://armisael.silix.org/2010/03/how-to-use-emule-collection-file-in-mldonkey/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 22:54:54 +0000</pubDate>
		<dc:creator>Armisael</dc:creator>
				<category><![CDATA[Trick and Tips]]></category>
		<category><![CDATA[emule collection]]></category>
		<category><![CDATA[mldonkey]]></category>

		<guid isPermaLink="false">http://armisael.silix.org/?p=73</guid>
		<description><![CDATA[Well, this is not a plugin, neither a standalone or cross-platform application, it&#8217;s only a, well, I suppose we can call it workaround&#8230;
Emule collections are files used to store the ed2k link of one or (usually) more files. They can be in two different format, text or byte.
In the lucky case we have a text based [...]]]></description>
			<content:encoded><![CDATA[<p>Well, this is <span style="text-decoration: underline;">not</span> a plugin, neither a standalone or cross-platform application, it&#8217;s only a, well, I suppose we can call it workaround&#8230;</p>
<p>Emule collections are files used to store the ed2k link of one or (usually) more files. They can be in two different format, text or byte.</p>
<p>In the lucky case we have a text based emule collection file and we want to start downloading with mlDonkey all the files linked in it, we have only to copy the content of the file and paste it in the &#8220;Direct Link&#8221; window of mlDonkey (the one that is shown clicking on &#8220;DL&#8221; on the top menu, yep, that one). In fact this window let us to start downloading all the links we write in it, one for line.</p>
<p>Unfortunately, in most cases the files we find on the net are not text-based. In fact when we open them with a text editor we see a lot of strange characters. These files store more information about each file (have a look <a href="http://code.google.com/p/amule-emc/wiki/emulecollection" target="_blank">here</a> if you are curious). We don&#8217;t need so much data, so the idea is to extract from the file the only one thing we need: the ed2k link of each file. We can do that with the source code of the amule-emc plugin. This plugin is used by amule exactly for reading emule collection files and using them in the application.</p>
<p>First of all we need the amule plugin code, we can download it from here: <a href="http://code.google.com/p/amule-emc/downloads/list" target="_blank">amule-emc download list</a>. I used with the version 0.5.2, the last at the moment. Unpack the archive somewhere and open the plugin folder. We need only some source files, so enter the source folder and compile them with g++ as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> amule-emc-x.x.x<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">g++</span> MuleCollection.cpp amule-emc.cpp <span style="color: #660033;">-o</span> ed2k_exporter</pre></div></div>

<p>The amule-emc.cpp file has a main function that reads the file passed as first argument and lists all the links. So now we can execute our new application simply with</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>ed2k_exporter filename.emulecollection</pre></div></div>

<p>where obviously we have to replace &#8220;filename.emulecollection&#8221; with our file. The result is that we will have all the links printed in our terminal, so the only thing we have to do now is to copy them and use the &#8220;Direct Link&#8221; window of mlDonkey, as before.</p>
]]></content:encoded>
			<wfw:commentRss>http://armisael.silix.org/2010/03/how-to-use-emule-collection-file-in-mldonkey/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MindGapper changes into MooGraph</title>
		<link>http://armisael.silix.org/2009/07/mindgapper-changes-into-moograph/</link>
		<comments>http://armisael.silix.org/2009/07/mindgapper-changes-into-moograph/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 10:35:57 +0000</pubDate>
		<dc:creator>Armisael</dc:creator>
				<category><![CDATA[Senza categoria]]></category>
		<category><![CDATA[mindgapper]]></category>
		<category><![CDATA[moograph]]></category>

		<guid isPermaLink="false">http://armisael.silix.org/?p=70</guid>
		<description><![CDATA[Yep, it is, MindGapper has been renamed into MooGraph.
Why? Well, it&#8217;s pretty simple, MindGapper was a funny name based on GapMinder, but now MindGapper &#8211; MooGraph is a complete software for statistical data, so we decided to change it&#8217;s name.
Sooner or later also the project on SourceForce will be renamed (we hope!), so keep on [...]]]></description>
			<content:encoded><![CDATA[<p>Yep, it is, MindGapper has been renamed into MooGraph.</p>
<p>Why? Well, it&#8217;s pretty simple, MindGapper was a funny name based on GapMinder, but now MindGapper &#8211; MooGraph is a complete software for statistical data, so we decided to change it&#8217;s name.</p>
<p>Sooner or later also the project on SourceForce will be renamed (we hope!), so keep on following us on our trac! And if you have questions, don&#8217;t heistate writing them down as comments!</p>
]]></content:encoded>
			<wfw:commentRss>http://armisael.silix.org/2009/07/mindgapper-changes-into-moograph/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails: remote functions do not work</title>
		<link>http://armisael.silix.org/2009/06/ruby-on-rails-remote-functions-do-not-work/</link>
		<comments>http://armisael.silix.org/2009/06/ruby-on-rails-remote-functions-do-not-work/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 09:56:37 +0000</pubDate>
		<dc:creator>Armisael</dc:creator>
				<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[prototype]]></category>
		<category><![CDATA[remote form tag]]></category>
		<category><![CDATA[remote function]]></category>

		<guid isPermaLink="false">http://armisael.silix.org/?p=57</guid>
		<description><![CDATA[Your remote_function or remote_form_tag could stop working if you use jQuery into your Ruby on Rails project. This is because the jQuery $ function is different from the prototype one, and RoR uses some particular function that is not available with jQuery.
For example, you can get an error like this submitting your remote_form_tag:

$(form).getElementsByTagName is not [...]]]></description>
			<content:encoded><![CDATA[<p>Your <em>remote_function</em> or <em>remote_form_tag</em> could stop working if you use jQuery into your Ruby on Rails project. This is because the jQuery $ function is different from the prototype one, and RoR uses some particular function that is not available with jQuery.</p>
<p>For example, you can get an error like this submitting your <em>remote_form_tag</em>:</p>

<div class="wp_syntax"><div class="code"><pre class="error" style="font-family:monospace;">$(form).getElementsByTagName is not a function
http://localhost:3000/javascripts/prototype.js?1239274532
Line 3483</pre></div></div>

<p>To solve this kind of problem, you have to use the jQuery no-conflict method, like explaned on the <a href="http://docs.jquery.com/Using_jQuery_with_Other_Libraries" target="_blank">jQuery site</a>. Simply add theese lines of code in your default layout between into a &lt;script&gt; tag:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jQuery.<span style="color: #660066;">noConflict</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
jQuery<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>Now, RoR can use prototype calling the default function $ and you can use jQuery using the jQuery function:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#myId&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;def&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://armisael.silix.org/2009/06/ruby-on-rails-remote-functions-do-not-work/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails: adding custom elements in generated xml</title>
		<link>http://armisael.silix.org/2009/04/ruby-on-rails-adding-custom-elements-in-generated-xml/</link>
		<comments>http://armisael.silix.org/2009/04/ruby-on-rails-adding-custom-elements-in-generated-xml/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 15:54:57 +0000</pubDate>
		<dc:creator>Armisael</dc:creator>
				<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://armisael.silix.org/?p=50</guid>
		<description><![CDATA[If you create a scaffold for your rails project, it will create for you a lot of things; for example, a way to show your object in xml format. But what about adding custom elements to that xml?
I solved in this way:

class MyObject &#60; ActiveRecord::Base
  #[...]
  def to_xml&#40;options=&#123;&#125;&#41;
    cp = [...]]]></description>
			<content:encoded><![CDATA[<p>If you create a scaffold for your rails project, it will create for you a lot of things; for example, a way to show your object in xml format. But what about adding custom elements to that xml?</p>
<p>I solved in this way:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> MyObject <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>
  <span style="color:#008000; font-style:italic;">#[...]</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> to_xml<span style="color:#006600; font-weight:bold;">&#40;</span>options=<span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    cp = attributes.<span style="color:#9900CC;">clone</span>
    cp<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;something&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#996600;">&quot;some value&quot;</span>
    cp<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;another thing&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">some_relation</span>.<span style="color:#9900CC;">length</span>
    cp.<span style="color:#9900CC;">to_xml</span><span style="color:#006600; font-weight:bold;">&#40;</span>options<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://armisael.silix.org/2009/04/ruby-on-rails-adding-custom-elements-in-generated-xml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AS3 &#8211; Flex: TileList with ItemRenderer scrolling problem</title>
		<link>http://armisael.silix.org/2009/04/as3-flex-tilelist-with-itemrenderer-scrolling-problem/</link>
		<comments>http://armisael.silix.org/2009/04/as3-flex-tilelist-with-itemrenderer-scrolling-problem/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 13:29:54 +0000</pubDate>
		<dc:creator>Armisael</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[actionscript 3]]></category>

		<guid isPermaLink="false">http://armisael.silix.org/?p=38</guid>
		<description><![CDATA[When using wx:TileList with your own ItemRenderer, you have to remember two important things to avoid scrolling problems:

If you override the set data method, remember to call super.data = value.
Remember that the TileList reuses the ItemRenderer instances when scrolling the component! So, if you have a TileList with 5 rows and 5 cols, and an [...]]]></description>
			<content:encoded><![CDATA[<p>When using wx:TileList with your own ItemRenderer, you have to remember two important things to avoid scrolling problems:</p>
<ol>
<li>If you override the set data method, remember to call super.data = value.</li>
<li>Remember that the TileList reuses the ItemRenderer instances when scrolling the component! So, if you have a TileList with 5 rows and 5 cols, and an array with 500 elements as DataProvider, it will create about 25 instances of your ItemRenderer, calling the set data method on them when scrolling. So, if you add some child to your ItemRenderer under some data condition (like I did), remember to remove them if the data condition is not valid.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://armisael.silix.org/2009/04/as3-flex-tilelist-with-itemrenderer-scrolling-problem/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>AS3: write a simple undefined loader</title>
		<link>http://armisael.silix.org/2009/03/as3-write-a-simple-undefined-loader/</link>
		<comments>http://armisael.silix.org/2009/03/as3-write-a-simple-undefined-loader/#comments</comments>
		<pubDate>Thu, 05 Mar 2009 20:11:24 +0000</pubDate>
		<dc:creator>Armisael</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[loader]]></category>
		<category><![CDATA[opensource]]></category>

		<guid isPermaLink="false">http://armisael.silix.org/?p=27</guid>
		<description><![CDATA[I love to write my own visual classes in actionscript3. Some days ago I was searching for an undefined loader, like a rotating animated gif. But I thought that it would be great to have something wrote in as3 to do that, so I code it.
I wrote a simple as3 class that shows some circles [...]]]></description>
			<content:encoded><![CDATA[<p>I love to write my own visual classes in actionscript3. Some days ago I was searching for an undefined loader, like a rotating animated gif. But I thought that it would be great to have something wrote in as3 to do that, so I code it.</p>
<p>I wrote a simple as3 class that shows some circles that moves from a point to the external of the loader, creating a simple bubble effect.</p>
<p>Here you can see it in action: <a href="http://armisael.silix.org/wp-content/uploads/2009/03/undefinedloaderexample1.swf" target="_blank">UndefinedLoader.swf</a></p>
<p>What do we need? Well, I usually use Caurina.Tweener for the animations, you can download it on <a href="http://code.google.com/p/tweener/">google code</a>. Download the as3 version and copy it in your source directory.</p>
<p>After that create a new class extending Sprite and create a simple costructor like this:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">package myControls
<span style="color: #66cc66;">&#123;</span>
    <span style="color: #0066CC;">import</span> caurina.<span style="color: #006600;">transitions</span>.<span style="color: #006600;">Tweener</span>;
    <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #66cc66;">*</span>;
&nbsp;
    <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> UndefinedLoader <span style="color: #0066CC;">extends</span> Sprite
    <span style="color: #66cc66;">&#123;</span>
        <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> w:<span style="color: #0066CC;">Number</span>;
        <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> h:<span style="color: #0066CC;">Number</span>;
        <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> colors:<span style="color: #0066CC;">Array</span> = <span style="color: #66cc66;">&#91;</span>0xFFFFFF<span style="color: #66cc66;">&#93;</span>;
&nbsp;
        <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> UndefinedLoader<span style="color: #66cc66;">&#40;</span>w:<span style="color: #0066CC;">Number</span>, h:<span style="color: #0066CC;">Number</span>, colors:<span style="color: #0066CC;">Array</span> = <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span>
        <span style="color: #66cc66;">&#123;</span>
            <span style="color: #0066CC;">this</span>.<span style="color: #006600;">w</span> = w;
            <span style="color: #0066CC;">this</span>.<span style="color: #006600;">h</span> = h;
            <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">visible</span> = <span style="color: #000000; font-weight: bold;">false</span>;
            <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>colors <span style="color: #66cc66;">!</span>= <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span>
                <span style="color: #0066CC;">this</span>.<span style="color: #006600;">colors</span> = colors;
        <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>We set the width and height attributes, and if the user want to change the color of the loader we set it.<br />
We will use the &#8216;visible&#8217; attribute to indicate if the loader is running or not. So we have to write a get function for that:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">        <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> loading<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>: <span style="color: #0066CC;">Boolean</span> <span style="color: #66cc66;">&#123;</span>
           <span style="color: #b1b100;">return</span> <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">visible</span>;
        <span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>After that, we need some constants in the class, indicating the minimum and the maximum radius of the circles, the time for the animation, how many circles we want and the type of transition (see the Tweener documentation for the possible values)</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">        <span style="color: #0066CC;">private</span> const NCIRCLES: <span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">25</span>;
        <span style="color: #0066CC;">private</span> const MIN_DURATION: <span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">1</span>;
        <span style="color: #0066CC;">private</span> const MAX_DURATION: <span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">2.5</span>;
        <span style="color: #0066CC;">private</span> const MIN_RADIUS:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">2</span>;
        <span style="color: #0066CC;">private</span> const MAX_RADIUS:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">5</span>;
        <span style="color: #0066CC;">private</span> const TRANSITION: <span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;linear&quot;</span>;</pre></div></div>

<p>Ok, now we need the start and the stop functions. When we start the loader, we want to create the circles, storing them into a private array. After that we will call the animation function on each of them. Stopping the loader will only hide it. The animation will automatically stop by itself (see later).</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">        <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>: <span style="color: #0066CC;">void</span>
        <span style="color: #66cc66;">&#123;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">visible</span><span style="color: #66cc66;">&#41;</span>
                <span style="color: #b1b100;">return</span>; <span style="color: #808080; font-style: italic;">// animazione gia` partita!</span>
&nbsp;
            <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">visible</span> = <span style="color: #000000; font-weight: bold;">true</span>;
&nbsp;
            <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>circles.<span style="color: #0066CC;">length</span> == <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>
                <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">0</span>; i <span style="color: #66cc66;">&amp;</span>lt; NCIRCLES; i++<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
                    circles<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span> = <span style="color: #000000; font-weight: bold;">new</span> Sprite<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
                    addChild<span style="color: #66cc66;">&#40;</span>circles<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
                <span style="color: #66cc66;">&#125;</span>
&nbsp;
            <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span>i = <span style="color: #cc66cc;">0</span>; i <span style="color: #66cc66;">&amp;</span>lt; circles.<span style="color: #0066CC;">length</span>; i++<span style="color: #66cc66;">&#41;</span>
                tween<span style="color: #66cc66;">&#40;</span>circles<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
        <span style="color: #66cc66;">&#125;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">        <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">stop</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>: <span style="color: #0066CC;">void</span>
        <span style="color: #66cc66;">&#123;</span>
            <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">visible</span> = <span style="color: #000000; font-weight: bold;">false</span>;
        <span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Now let we write the tween function: first of all we need to check if the loader is still shown. If it&#8217;s not, we will return, doing nothing. Otherwise, we generate randomly the color of the circle, the duration of the animation, the radius and the angle to move on. After that, reset the circles attribute, redraw it, and start the animation. When it will be completed, it will be recalled the tween function, checking if the loader is still working or not.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">        <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> tween<span style="color: #66cc66;">&#40;</span>c:Sprite<span style="color: #66cc66;">&#41;</span>: <span style="color: #0066CC;">void</span>
        <span style="color: #66cc66;">&#123;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">!</span><span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">visible</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
                <span style="color: #b1b100;">return</span>; <span style="color: #808080; font-style: italic;">// fermiamo l'animazione.</span>
            <span style="color: #66cc66;">&#125;</span>
&nbsp;
            <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">color</span>:<span style="color: #0066CC;">int</span> = <span style="color: #66cc66;">&#40;</span>colors.<span style="color: #0066CC;">length</span> == <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> ? colors<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span> : <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">abs</span><span style="color: #66cc66;">&#40;</span>colors<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#93;</span>-colors<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
            <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">time</span>:<span style="color: #0066CC;">Number</span> = <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #66cc66;">&#40;</span>MAX_DURATION - MIN_DURATION<span style="color: #66cc66;">&#41;</span>;
            <span style="color: #000000; font-weight: bold;">var</span> radius:<span style="color: #0066CC;">Number</span> = <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #66cc66;">&#40;</span>MAX_RADIUS - MIN_RADIUS<span style="color: #66cc66;">&#41;</span>;
            <span style="color: #000000; font-weight: bold;">var</span> beta:<span style="color: #0066CC;">Number</span> = <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">*</span><span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">PI</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
            c.<span style="color: #006600;">alpha</span> = <span style="color: #cc66cc;">1</span>;
            c.<span style="color: #006600;">x</span> = <span style="color: #cc66cc;">0</span>;
            c.<span style="color: #006600;">y</span> = <span style="color: #cc66cc;">0</span>;
            c.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">clear</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
            c.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">lineStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span>, <span style="color: #0066CC;">color</span>, <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
            c.<span style="color: #006600;">graphics</span>.<span style="color: #006600;">drawCircle</span><span style="color: #66cc66;">&#40;</span>w<span style="color: #66cc66;">/</span><span style="color: #cc66cc;">2</span>, h<span style="color: #66cc66;">/</span><span style="color: #cc66cc;">2</span>, radius<span style="color: #66cc66;">&#41;</span>;
&nbsp;
            Tweener.<span style="color: #006600;">addTween</span><span style="color: #66cc66;">&#40;</span>c, <span style="color: #66cc66;">&#123;</span>x:w<span style="color: #66cc66;">/</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">*</span><span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">cos</span><span style="color: #66cc66;">&#40;</span>beta<span style="color: #66cc66;">&#41;</span>, y:h<span style="color: #66cc66;">/</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">*</span><span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">sin</span><span style="color: #66cc66;">&#40;</span>beta<span style="color: #66cc66;">&#41;</span>,
                                 alpha:<span style="color: #cc66cc;">0</span>, <span style="color: #0066CC;">time</span>:<span style="color: #0066CC;">time</span>, transition:TRANSITION,
                                 onComplete: tween, onCompleteParams:<span style="color: #66cc66;">&#91;</span>c<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#125;</span> <span style="color: #66cc66;">&#41;</span>;
        <span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>You can download the source code here: <a href="http://armisael.silix.org/wp-content/uploads/2009/03/undefinedloader.as">undefinedloader.as</a></p>
]]></content:encoded>
			<wfw:commentRss>http://armisael.silix.org/2009/03/as3-write-a-simple-undefined-loader/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu 8.10 and MacBook Pro: audio problem</title>
		<link>http://armisael.silix.org/2008/11/ubuntu-810-and-macbook-pro-audio-problem/</link>
		<comments>http://armisael.silix.org/2008/11/ubuntu-810-and-macbook-pro-audio-problem/#comments</comments>
		<pubDate>Mon, 03 Nov 2008 17:39:09 +0000</pubDate>
		<dc:creator>Armisael</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[8.10]]></category>
		<category><![CDATA[audio problem]]></category>
		<category><![CDATA[hda-intel]]></category>
		<category><![CDATA[macbook pro]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://armisael.silix.org/?p=23</guid>
		<description><![CDATA[I have a MacBook Pro 4th generation (Penryn) and using Ubuntu 8.04 all was  perfect!
Two days ago I upgraded the operating system to Intrepid Ibex (8.10), and after some hour downloading the packages and installing them, the new Ubuntu was running on my MacBook&#8230; But also some problems war running as well! Ubuntu has some [...]]]></description>
			<content:encoded><![CDATA[<p>I have a MacBook Pro 4th generation (Penryn) and using Ubuntu 8.04 all was  perfect!</p>
<p>Two days ago I upgraded the operating system to Intrepid Ibex (8.10), and after some hour downloading the packages and installing them, the new Ubuntu was running on my MacBook&#8230; But also some problems war running as well! Ubuntu has some audio problem (no sound at all!!) on MacBook Pro&#8230;</p>
<p>The sound card is the Hda-Intel and the kernel module is the snd-hda-intel. The solution? After some search on the net, I found that: <a href="https://help.ubuntu.com/community/MacBookPro_Penryn#Enabling%20Sound/Microphone">help.ubuntu.com</a></p>
<p>Here the solution (very easy, really):</p>
<p>1. Open the file /etc/modprobe.d/options (you need to be root)</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> gedit <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>modprobe.d<span style="color: #000000; font-weight: bold;">/</span>options</pre></div></div>

</blockquote>
<p>2. Add the following line at the end of the file</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">options snd_hda_intel <span style="color: #007800;">model</span>=mbp3</pre></div></div>

</blockquote>
<p>3. If you have changed /etc/modprobe.d/alsa-base previously, adding something similar to the previous line, comment it.</p>
<p>4. Reboot (mute your microphone before doing that, or your ears will implore pity!)</p>
]]></content:encoded>
			<wfw:commentRss>http://armisael.silix.org/2008/11/ubuntu-810-and-macbook-pro-audio-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why a blog?</title>
		<link>http://armisael.silix.org/2008/09/why-a-blog/</link>
		<comments>http://armisael.silix.org/2008/09/why-a-blog/#comments</comments>
		<pubDate>Fri, 26 Sep 2008 17:26:41 +0000</pubDate>
		<dc:creator>Armisael</dc:creator>
				<category><![CDATA[Senza categoria]]></category>
		<category><![CDATA[about me]]></category>
		<category><![CDATA[introduction]]></category>

		<guid isPermaLink="false">http://armisael.silix.org/?p=10</guid>
		<description><![CDATA[In my informatic life I&#8217;ve wrote a lot of code lines, and sometimes I&#8217;ve spent hours and hours searching on the web the solution to problems, finding them on forums and blogs. But sometimes people that solve their problems don&#8217;t write it down their solutions, or sometimes the discussion about how to solve something is [...]]]></description>
			<content:encoded><![CDATA[<p>In my informatic life I&#8217;ve wrote a lot of code lines, and sometimes I&#8217;ve spent hours and hours searching on the web the solution to problems, finding them on forums and blogs. But sometimes people that solve their problems don&#8217;t write it down their solutions, or sometimes the discussion about how to solve something is very very chaotic.</p>
<p>I&#8217;ve decided to write down the solution to my informatic problem here, hoping that this will help someone to solve their ones.</p>
<p>Another reason of this blog is that I&#8217;ve to improve my english, and the only way to do it is to use it! So first of all, I&#8217;m sorry for all the mistakes you will find on this blog, but I&#8217;m italian and is known that Italy people like only their own language&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://armisael.silix.org/2008/09/why-a-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
