<?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>smartcode</title>
	<atom:link href="http://www.smartcode.ch/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.smartcode.ch</link>
	<description>software made smart</description>
	<lastBuildDate>Sun, 29 Jan 2012 11:25:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>iTunes Like Flex Search TextInput</title>
		<link>http://www.smartcode.ch/blog/flex/itunes-like-flex-search-text-input/</link>
		<comments>http://www.smartcode.ch/blog/flex/itunes-like-flex-search-text-input/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 22:06:06 +0000</pubDate>
		<dc:creator>Rico Leuthold</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://www.smartcode.ch/?p=1105</guid>
		<description><![CDATA[While thinking about how to implement and style a slick text based filter for data shown in a Flex DataGrid I stumbled upon the solution when searching for some of my favorite songs in iTunes. The search field in iTunes offers exactly the functionality I was looking for, packed in Apple&#8217;s usual understated style. Well, &#8230; <a href="http://www.smartcode.ch/blog/flex/itunes-like-flex-search-text-input/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.smartcode.ch/wp-content/uploads/2012/01/itunes-like-flex-search-text-input.png"><img class="alignright size-full wp-image-1110" title="itunes-like-flex-search-text-input" src="http://www.smartcode.ch/wp-content/uploads/2012/01/itunes-like-flex-search-text-input.png" alt="" width="186" height="173" /></a>While thinking about how to implement and style a slick text based filter for data shown in a Flex <code>DataGrid</code> I stumbled upon the solution when searching for some of my favorite songs in <a title="iTunes" href="http://www.apple.com/itunes/" target="_blank">iTunes</a>.</p>
<p>The search field in <em>iTunes</em> offers exactly the functionality I was looking for, packed in Apple&#8217;s usual understated style.</p>
<p>Well, this was definitely a challenging task for me in terms of <a title="Flex 4 Skinning" href="http://www.adobe.com/devnet/flex/articles/flex4_skinning.html" target="_blank">skinning</a>.</p>
<p><span id="more-1105"></span></p>
<p>However, I&#8217;m quite pleased with the result. The component looks appealing and fulfills its function.</p>
<p><a href="http://www.smartcode.ch/wp-content/uploads/2012/01/itunes-like-flex-search-text-input-overview.png"><img class="size-large wp-image-1109 alignnone" title="itunes-like-flex-search-text-input-overview" src="http://www.smartcode.ch/wp-content/uploads/2012/01/itunes-like-flex-search-text-input-overview-680x190.png" alt="" width="680" height="190" /></a></p>
<p>But not only the <em>nested</em> skinning of the component was challenging. I ran into a lot of troubles with the positioning and sizing of all the sub-components. Especially the sizing of the <code>DropDownList</code> cost me some nerves. But after repeated insertion and deletion of <code>width="100%"</code> here and there it finally looked as desired.</p>
<p>If you want to see the result, check out the <a title="iTunes Like Flex Search TextInput demo" href="http://showcase.smartcode.ch/itunes-like-flex-search-text-input/" target="_blank">demo</a>. Or if you are after the code and information on how to use the component, go to <a title="github repository" href="https://github.com/smartcode-ch/iTunes-Like-Flex-Search-TextInput" target="_blank">github</a>. There is definitely room for improvements, code and design wise.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smartcode.ch/blog/flex/itunes-like-flex-search-text-input/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Prevent Google Apps Mail Service from Rewriting the Sender Address</title>
		<link>http://www.smartcode.ch/blog/system-administration/prevent-google-apps-mail-service-from-rewriting-the-sender-address/</link>
		<comments>http://www.smartcode.ch/blog/system-administration/prevent-google-apps-mail-service-from-rewriting-the-sender-address/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 13:33:03 +0000</pubDate>
		<dc:creator>Rico Leuthold</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Google Apps]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[Prevent]]></category>
		<category><![CDATA[Sender Rewrite]]></category>
		<category><![CDATA[sSMTP]]></category>

		<guid isPermaLink="false">http://www.smartcode.ch/?p=1075</guid>
		<description><![CDATA[I recently set up the mail service for my new smartcode domain using Google Apps. Subscription and setup of the Google Apps account with some mail addresses is a simple and straightforward process. However, when I sent mails from my server (using sSMTP) with sender addresses like blog@smartcode.ch or wiki@smartcode.ch, they all arrived in my &#8230; <a href="http://www.smartcode.ch/blog/system-administration/prevent-google-apps-mail-service-from-rewriting-the-sender-address/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I recently set up the mail service for my new smartcode domain using <a title="Google Apps for free" href="http://www.google.com/apps/intl/en/group/index.html" target="_blank">Google Apps</a>. Subscription and setup of the <em>Google Apps</em> account with some mail addresses is a simple and straightforward process.</p>
<p>However, when I sent mails from my server (using <a title="sSMTP" href="http://wiki.dreamhost.com/SSMTP" target="_blank">sSMTP</a>) with sender addresses like <em>blog@smartcode.ch</em> or <em>wiki@smartcode.ch</em>, they all arrived in my inbox with the sender address set in the <code>ssmtp.conf</code> file.</p>
<p>Read on for instructions to configure <em>Google Apps</em> mail service to allow some kind of <em>alias addresses</em> for a mail address.</p>
<p><span id="more-1075"></span></p>
<p>First of all, login to the Google Apps administration site and create a new user, which servers as the mail account for all the aliases you create afterwards. I named mine <em>mailer@smartcode.ch</em>.</p>
<p><a href="http://www.smartcode.ch/wp-content/uploads/2012/01/google-apps-create-user.png"><img class="size-full wp-image-1086 alignnone" title="google-apps-create-user" src="http://www.smartcode.ch/wp-content/uploads/2012/01/google-apps-create-user.png" alt="Google Apps create user" width="580" height="244" /></a></p>
<p>Next, log in to google mail with your newly created account, and open the <strong>Mail settings</strong>. Select the <strong>Accounts</strong> tab, and click the <strong>Add another email address you own</strong> link. Enter your desired mail address in the Pop-Up, go on to the <strong>Next Step</strong> and click the <strong>Send Verification</strong> button.</p>
<div style="overflow: hidden">
<div style="float: left; padding-right: 5px;">
<a href="http://www.smartcode.ch/wp-content/uploads/2012/01/google-mail-login.png"><img class="alignleft size-thumbnail wp-image-1090" title="google-mail-login" src="http://www.smartcode.ch/wp-content/uploads/2012/01/google-mail-login-215x180.png" alt="" width="215" height="180" /></a>
</div>
<div style="float: left; padding-right: 5px;">
<a href="http://www.smartcode.ch/wp-content/uploads/2012/01/google-mail-settings.png"><img class="alignleft size-full wp-image-1093" title="google-mail-settings" src="http://www.smartcode.ch/wp-content/uploads/2012/01/google-mail-settings.png" alt="" width="187" height="159" /></a>
</div>
<div style="float: left;">
<a href="http://www.smartcode.ch/wp-content/uploads/2012/01/google-mail-add-address.png"><img class="alignleft size-thumbnail wp-image-1088" title="google-mail-add-address" src="http://www.smartcode.ch/wp-content/uploads/2012/01/google-mail-add-address-215x75.png" alt="" width="215" height="75" /></a>
</div>
</div>
<p>The verification mail is sent to your administrative account of your <em>Google Apps</em> account. Spot the verification code and verify the account.</p>
<p>If you want to make the mail <em>alias</em> a no-reply address, change to the <strong>Filters</strong> tab in the mail settings view, and <strong>Create a new filter</strong>.</p>
<p><a href="http://www.smartcode.ch/wp-content/uploads/2012/01/google-mail-new-filter.png"><img class="size-large wp-image-1092 alignnone" title="google-mail-new-filter" src="http://www.smartcode.ch/wp-content/uploads/2012/01/google-mail-new-filter-680x174.png" alt="" width="590" height="150" /></a></p>
<p>Insert the mail <em>alias</em> address in the <strong>To:</strong> field and click <strong>Next Step</strong>. Select the <strong>Delete it</strong> action and create the filter.</p>
<p><a href="http://www.smartcode.ch/wp-content/uploads/2012/01/google-mail-new-filter-rules.png"><img class="alignnone size-full wp-image-1091" title="google-mail-new-filter-rules" src="http://www.smartcode.ch/wp-content/uploads/2012/01/google-mail-new-filter-rules.png" alt="" width="679" height="326" /></a></p>
<p>This is all there is for the <em>Google Apps / Mail</em> configuration.</p>
<p>On the server side, configure <em>sSMTP</em> for your mailer account. My <code>ssmtp.conf</code> file looks as follow:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Config file for sSMTP sendmail</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># The person who gets all mail for userids &amp;lt; 1000</span>
<span style="color: #666666; font-style: italic;"># Make this empty to disable rewriting.</span>
<span style="color: #007800;">root</span>=
&nbsp;
<span style="color: #666666; font-style: italic;"># The place where the mail goes. The actual machine name is required no</span>
<span style="color: #666666; font-style: italic;"># MX records are consulted. Commonly mailhosts are named mail.domain.com</span>
<span style="color: #007800;">mailhub</span>=smtp.gmail.com:<span style="color: #000000;">587</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Where will the mail seem to come from?</span>
<span style="color: #007800;">rewriteDomain</span>=
&nbsp;
<span style="color: #666666; font-style: italic;"># The full hostname</span>
<span style="color: #007800;">hostname</span>=smartcode.ch
&nbsp;
<span style="color: #007800;">UseTLS</span>=Yes
<span style="color: #007800;">UseSTARTTLS</span>=YES
&nbsp;
<span style="color: #007800;">AuthUser</span>=mailer<span style="color: #000000; font-weight: bold;">@</span>smartcode.ch
<span style="color: #007800;">AuthPass</span>=<span style="color: #000000; font-weight: bold;">**********</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Are users allowed to set their own From: address?</span>
<span style="color: #666666; font-style: italic;"># YES - Allow the user to specify their own From: address</span>
<span style="color: #666666; font-style: italic;"># NO - Use the system generated From: address</span>
<span style="color: #007800;">FromLineOverride</span>=YES</pre></div></div>

<p>With this setup I can configure my services (e.g. <a title="DokuWiki" href="http://www.dokuwiki.org/dokuwiki" target="_blank">DokuWiki</a>) running on the server to send mails from any desired mail address using <em>Google Apps</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smartcode.ch/blog/system-administration/prevent-google-apps-mail-service-from-rewriting-the-sender-address/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Own Way, Own Name, New Pleasure</title>
		<link>http://www.smartcode.ch/uncategorized/own-way-own-name-own-pleasure/</link>
		<comments>http://www.smartcode.ch/uncategorized/own-way-own-name-own-pleasure/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 11:37:30 +0000</pubDate>
		<dc:creator>Rico Leuthold</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.smartcode.ch/?p=864</guid>
		<description><![CDATA[The circumstances forced me to go my own way. This is why my blog moved to the domain smartcode.ch. Let me know whatever you want me to know &#8211; about the design, usability, name, etc.]]></description>
			<content:encoded><![CDATA[<p>The circumstances forced me to go my own way. This is why my blog moved to the domain smartcode.ch.</p>
<p>Let me know whatever you want me to know &#8211; about the design, usability, name, etc.</p>
<p><span id="more-864"></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.smartcode.ch/uncategorized/own-way-own-name-own-pleasure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to add skin states to Flex 4 containers</title>
		<link>http://www.smartcode.ch/blog/flex/how-to-add-skin-states-to-flex-4-containers/</link>
		<comments>http://www.smartcode.ch/blog/flex/how-to-add-skin-states-to-flex-4-containers/#comments</comments>
		<pubDate>Thu, 03 Nov 2011 10:32:58 +0000</pubDate>
		<dc:creator>Rico Leuthold</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://blog.to-fuse.ch/?p=402</guid>
		<description><![CDATA[There is an excellent article over at newtriks (referencing other excellent articles regarding this subject) on how to add skin states to Flex 4 Containers using ActionScript. I implemented my custom SkinState using the information provided, but never succeeded. There was definitely something missing, which was not obvious to me. After some (really long) time &#8230; <a href="http://www.smartcode.ch/blog/flex/how-to-add-skin-states-to-flex-4-containers/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There is an excellent article over at <a href="http://www.newtriks.com/2010/09/24/managing-states-in-flex-4-containers-using-actionscript/" title="Managing States in Flex 4 Containers Using ActionScript" target="_blank">newtriks</a> (referencing other excellent articles regarding this subject) on how to add skin states to Flex 4 Containers using ActionScript.</p>
<p>I implemented my custom <code>SkinState</code> using the information provided, but never succeeded. There was definitely something missing, which was not obvious to me.</p>
<p><span id="more-417"></span></p>
<p>After some (really long) time of inspecting variables and tracing method return values, I noticed, that the <code>getCurrentSkinState():String</code> method return <code>null</code> values.</p>
<p>As is so often, a web search session revealed the missing piece of information. A <a href="http://help.adobe.com/en_US/flex/using/WS460ee381960520ad-2811830c121e9107ecb-7ff9.html#WS03d33b8076db57b9-a120b14121ef5f63a3-7fff" title="Implementing the getCurrentSkinState() method for skinnable components" target="_blank">paragraph</a> in the Adobe Flex 4.5 docs called <a href="http://help.adobe.com/en_US/flex/using/WS460ee381960520ad-2811830c121e9107ecb-7ff9.html" title="Implementing the component" target="_blank">Implementing the component</a>, explains in detail how to override the <code>getCurrentSkinState():String</code> method in order to get your custom skin state name returned properly.</p>
<p><cite>You can use information in the class to determine the new view state.</cite></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">override <span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> getCurrentSkinState<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> <span style="color: #000000;">&#123;</span>
    <span style="color: #6699cc; font-weight: bold;">var</span> returnState<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">&quot;normal&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
    <span style="color: #009900; font-style: italic;">// Use information in the class to determine</span>
    <span style="color: #009900; font-style: italic;">// the new view state of the skin class.</span>
    <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>_textPlacement == <span style="color: #990000;">&quot;left&quot;</span><span style="color: #000000;">&#41;</span>     <span style="color: #000000;">&#123;</span>
        returnState = <span style="color: #990000;">&quot;textLeft&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #000000;">&#125;</span>
    <span style="color: #0033ff; font-weight: bold;">return</span> returnState<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Or applied to a component with several defined states ( e.g. <code>RadioButton</code>) which should still work:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">override <span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> getCurrentSkinState<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> <span style="color: #000000;">&#123;</span>
&nbsp;
    <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> _highlight <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">return</span> <span style="color: #990000;">&quot;highlight&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #000000;">&#125;</span>
&nbsp;
    <span style="color: #0033ff; font-weight: bold;">return</span> <span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000066; font-weight: bold;">.</span>getCurrentSkinState<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.smartcode.ch/blog/flex/how-to-add-skin-states-to-flex-4-containers/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Determine if an element is visible in a scrollable Spark DataGrid</title>
		<link>http://www.smartcode.ch/blog/flex/determine-if-an-element-is-visible-in-a-scrollable-spark-datagrid/</link>
		<comments>http://www.smartcode.ch/blog/flex/determine-if-an-element-is-visible-in-a-scrollable-spark-datagrid/#comments</comments>
		<pubDate>Thu, 03 Nov 2011 09:30:23 +0000</pubDate>
		<dc:creator>Rico Leuthold</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://blog.to-fuse.ch/?p=390</guid>
		<description><![CDATA[By digging in the Flex 4.5 API docs I&#8217;ve found a way to determine if a certain element (object) of the spark.components.DataGrid.dataProvider is visible in the viewport of the spark.components.Scroller wrapping the DataGrid. The spark.components.Grid offers a method 1 isCellVisible&#40;rowIndex:int = -1, columnIndex:int = -1&#41;:Boolean Since the spark.components.Grid represents the grid part of the spark.components.DataGrid, &#8230; <a href="http://www.smartcode.ch/blog/flex/determine-if-an-element-is-visible-in-a-scrollable-spark-datagrid/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>By digging in the <a href="http://www.smartcode.ch/os-x/create-flex-4-5-api-docs-for-offline-view-on-mac-os-x/" title="Create Flex 4.5.* API docs for offline view on Mac OS X">Flex 4.5 API docs</a> I&#8217;ve found a way to determine if a certain element (object) of the <code>spark.components.DataGrid.dataProvider</code> is visible in the viewport of the <code>spark.components.Scroller</code> wrapping the <code>DataGrid</code>.</p>
<p><span id="more-416"></span></p>
<p>The <code>spark.components.Grid</code> offers a method</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;">isCellVisible<span style="color: #000000;">&#40;</span>rowIndex<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span> = <span style="color: #000066; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">,</span> columnIndex<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span> = <span style="color: #000066; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span></pre></td></tr></table></div>

<p>Since the <code>spark.components.Grid</code> represents the grid part of the <code>spark.components.DataGrid</code>, the method can be called as follows:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;">dataGrid<span style="color: #000066; font-weight: bold;">.</span>grid<span style="color: #000066; font-weight: bold;">.</span>isCellVisible<span style="color: #000000;">&#40;</span>rowIndex<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;.</span></pre></td></tr></table></div>

<p>You can call this method in an event listener to determine if a row (element) is visible in the scroller:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;">dataGrid<span style="color: #000066; font-weight: bold;">.</span>scroller<span style="color: #000066; font-weight: bold;">.</span>verticalScrollBar<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>
    TrackBaseEvent<span style="color: #000066; font-weight: bold;">.</span>THUMB_RELEASE<span style="color: #000066; font-weight: bold;">,</span>updateIsItemVisible
<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> updateIsItemVisible<span style="color: #000000;">&#40;</span> e<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">visible</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span> = dataGrid<span style="color: #000066; font-weight: bold;">.</span>grid<span style="color: #000066; font-weight: bold;">.</span>isCellVisible<span style="color: #000000;">&#40;</span> _itemIndex <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.smartcode.ch/blog/flex/determine-if-an-element-is-visible-in-a-scrollable-spark-datagrid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spark DataGrid column with an itemRenderer and a labelFunction</title>
		<link>http://www.smartcode.ch/blog/flex/spark-datagrid-column-with-itemrenderer-and-labelfunction/</link>
		<comments>http://www.smartcode.ch/blog/flex/spark-datagrid-column-with-itemrenderer-and-labelfunction/#comments</comments>
		<pubDate>Wed, 02 Nov 2011 15:52:35 +0000</pubDate>
		<dc:creator>Rico Leuthold</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://blog.to-fuse.ch/?p=363</guid>
		<description><![CDATA[Ever tried to use an ItemRender and a labelFunction for a Spark DataGrid GridColumn at the same time with the GridItemRenderer template provided by Flash Builder? If you run into problems as well, read on for a simple solution. I&#8217;m not an expert when it comes to the point where you have to override Flex &#8230; <a href="http://www.smartcode.ch/blog/flex/spark-datagrid-column-with-itemrenderer-and-labelfunction/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Ever tried to use an <code>ItemRender</code> and a <code>labelFunction</code> for a Spark <code>DataGrid GridColumn</code> at the same time with the <code>GridItemRenderer</code> template provided by Flash Builder? If you run into problems as well, read on for a simple solution.</p>
<p><span id="more-415"></span></p>
<p>I&#8217;m not an expert when it comes to the point where you have to override Flex framework methods. However, if you need a custom <code>ItemRenderer</code> for a spark <code>DataGrid</code>, Flash Builder 4.5 creates a template like the following for you.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">&lt;?</span>xml <span style="color: #004993;">version</span>=<span style="color: #990000;">&quot;1.0&quot;</span> encoding=<span style="color: #990000;">&quot;utf-8&quot;</span><span style="color: #000066; font-weight: bold;">?&gt;</span>
<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>GridItemRenderer xmlns<span style="color: #000066; font-weight: bold;">:</span>fx=<span style="color: #990000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span>
                    xmlns<span style="color: #000066; font-weight: bold;">:</span>s=<span style="color: #990000;">&quot;library://ns.adobe.com/flex/spark&quot;</span>
                    xmlns<span style="color: #000066; font-weight: bold;">:</span>mx=<span style="color: #990000;">&quot;library://ns.adobe.com/flex/mx&quot;</span> clipAndEnableScrolling=<span style="color: #990000;">&quot;true&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
&nbsp;
   <span style="color: #000066; font-weight: bold;">&lt;</span>fx<span style="color: #000066; font-weight: bold;">:</span>Script<span style="color: #000066; font-weight: bold;">&gt;</span>
      <span style="color: #000066; font-weight: bold;">&lt;!</span><span style="color: #000000;">&#91;</span>CDATA<span style="color: #000000;">&#91;</span>
         override <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> prepare<span style="color: #000000;">&#40;</span>hasBeenRecycled<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
	    lblData<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span> = <span style="color: #004993;">data</span><span style="color: #000000;">&#91;</span>column<span style="color: #000066; font-weight: bold;">.</span>dataField<span style="color: #000000;">&#93;</span>
	 <span style="color: #000000;">&#125;</span>
      <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
   <span style="color: #000066; font-weight: bold;">&lt;/</span>fx<span style="color: #000066; font-weight: bold;">:</span>Script<span style="color: #000066; font-weight: bold;">&gt;</span>
&nbsp;
   <span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>Label id=<span style="color: #990000;">&quot;lblData&quot;</span> <span style="color: #004993;">top</span>=<span style="color: #990000;">&quot;9&quot;</span> <span style="color: #004993;">left</span>=<span style="color: #990000;">&quot;7&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">&lt;/</span>s<span style="color: #000066; font-weight: bold;">:</span>GridItemRenderer<span style="color: #000066; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

<p>But, if you specified a <code>labelFunction</code> for the same <code>GridColumn</code> this <code>ItemRenderer</code> is attached to, you will get an error similar to the following:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #004993;">ReferenceError</span><span style="color: #000066; font-weight: bold;">:</span> <span style="color: #004993;">Error</span> #<span style="color: #000000; font-weight:bold;">1069</span><span style="color: #000066; font-weight: bold;">:</span> Property <span style="color: #0033ff; font-weight: bold;">null</span> not found on <span style="color: #004993;">data</span> and there <span style="color: #0033ff; font-weight: bold;">is</span> no <span style="color: #0033ff; font-weight: bold;">default</span> <span style="color: #004993;">value</span><span style="color: #000066; font-weight: bold;">.</span>
                at ch<span style="color: #000066; font-weight: bold;">.</span>tofuse<span style="color: #000066; font-weight: bold;">.</span>renderers<span style="color: #000066; font-weight: bold;">::</span>ResultGridItemRenderer<span style="color: #000066; font-weight: bold;">/</span>prepare<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></pre></td></tr></table></div>

<p>The fix is simple, once you understand that the template code for the <code>prepare</code> method is not really safe to use in this case.</p>
<p>Update the <code>prepare</code> method to look as follows.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">&lt;?</span>xml <span style="color: #004993;">version</span>=<span style="color: #990000;">&quot;1.0&quot;</span> encoding=<span style="color: #990000;">&quot;utf-8&quot;</span><span style="color: #000066; font-weight: bold;">?&gt;</span>
<span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>GridItemRenderer xmlns<span style="color: #000066; font-weight: bold;">:</span>fx=<span style="color: #990000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span>
                    xmlns<span style="color: #000066; font-weight: bold;">:</span>s=<span style="color: #990000;">&quot;library://ns.adobe.com/flex/spark&quot;</span>
                    xmlns<span style="color: #000066; font-weight: bold;">:</span>mx=<span style="color: #990000;">&quot;library://ns.adobe.com/flex/mx&quot;</span> clipAndEnableScrolling=<span style="color: #990000;">&quot;true&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
&nbsp;
   <span style="color: #000066; font-weight: bold;">&lt;</span>fx<span style="color: #000066; font-weight: bold;">:</span>Script<span style="color: #000066; font-weight: bold;">&gt;</span>
      <span style="color: #000066; font-weight: bold;">&lt;!</span><span style="color: #000000;">&#91;</span>CDATA<span style="color: #000000;">&#91;</span>
         override <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> prepare<span style="color: #000000;">&#40;</span>hasBeenRecycled<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
	   <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> column<span style="color: #000066; font-weight: bold;">.</span>labelFunction <span style="color: #000066; font-weight: bold;">!</span>= <span style="color: #0033ff; font-weight: bold;">null</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
	      lblData<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span> = column<span style="color: #000066; font-weight: bold;">.</span>labelFunction<span style="color: #000000;">&#40;</span> <span style="color: #004993;">data</span><span style="color: #000066; font-weight: bold;">,</span> column <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	   <span style="color: #000000;">&#125;</span> <span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #000000;">&#123;</span>
	      lblData<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span> = <span style="color: #004993;">data</span><span style="color: #000000;">&#91;</span>column<span style="color: #000066; font-weight: bold;">.</span>dataField<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">;</span>
	   <span style="color: #000000;">&#125;</span>
	 <span style="color: #000000;">&#125;</span>
      <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
   <span style="color: #000066; font-weight: bold;">&lt;/</span>fx<span style="color: #000066; font-weight: bold;">:</span>Script<span style="color: #000066; font-weight: bold;">&gt;</span>
&nbsp;
   <span style="color: #000066; font-weight: bold;">&lt;</span>s<span style="color: #000066; font-weight: bold;">:</span>Label id=<span style="color: #990000;">&quot;lblData&quot;</span> <span style="color: #004993;">top</span>=<span style="color: #990000;">&quot;9&quot;</span> <span style="color: #004993;">left</span>=<span style="color: #990000;">&quot;7&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">&lt;/</span>s<span style="color: #000066; font-weight: bold;">:</span>GridItemRenderer<span style="color: #000066; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.smartcode.ch/blog/flex/spark-datagrid-column-with-itemrenderer-and-labelfunction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex 4.5 MySQL Query Browser</title>
		<link>http://www.smartcode.ch/blog/flex/flex-4-5-mysql-query-browser/</link>
		<comments>http://www.smartcode.ch/blog/flex/flex-4-5-mysql-query-browser/#comments</comments>
		<pubDate>Wed, 29 Jun 2011 13:58:55 +0000</pubDate>
		<dc:creator>Rico Leuthold</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Data Paging]]></category>
		<category><![CDATA[Flex 4.5]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Zend AMF]]></category>

		<guid isPermaLink="false">http://blog.to-fuse.ch/?p=267</guid>
		<description><![CDATA[I was looking for a simple MySQL query browser to provide individuals who wish to learn SQL with a tool to get started. Since I couldn&#8217;t find a satisfactory software I decided to create one. The result consists of a Flex interface using Zend AMF for remoting, therefore PHP as backend technology, and is available &#8230; <a href="http://www.smartcode.ch/blog/flex/flex-4-5-mysql-query-browser/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was looking for a simple MySQL query browser to provide individuals who wish to learn SQL with a tool to get started. Since I couldn&#8217;t find a satisfactory software I decided to create one.</p>
<p><a href="http://www.smartcode.ch/wp-content/uploads/2011/06/query-browser-overview1.png"><img class="alignnone size-large wp-image-757" title="query-browser-overview" src="http://www.smartcode.ch/wp-content/uploads/2011/06/query-browser-overview1-680x435.png" alt="" width="680" height="435" /></a></p>
<p>The result consists of a <a title="Adobe Flex" href="http://www.adobe.com/products/flex/" target="_blank">Flex</a> interface using <a title="Zend AMF manual" href="http://framework.zend.com/manual/en/zend.amf.html" target="_blank">Zend AMF</a> for remoting, therefore <a title="PHP" href="http://www.php.net/" target="_blank">PHP</a> as backend technology, and is available for cloning and other experiments on <a href="https://github.com/smartcode-ch/QueryBrowser">github</a>.</p>
<p>Visit the <a title="Flex MySQL Query Browser" href="http://showcase.smartcode.ch/query-browser/" target="_blank">demo page </a>or watch the <a class="fancybox-swf {width:1024,height:675}" href="http://www.smartcode.ch/wp-content/uploads/2011/06/query-browser-screencast.swf">screencast</a> to see it in action.</p>
<p><span id="more-414"></span></p>
<h3>Objectives</h3>
<p>I wanted a simple application to query MySQL databases. From the user perspective the interface should be simple, clean and inviting. From a technical view, I wanted to get grip on the <a title="AsyncListView API" href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/collections/AsyncListView.html" target="_blank">AsyncListView</a> collection wrapper class introduced in Flex 4 which offers <a title="James Ward - Data Paging in Flex 4" href="http://www.jamesward.com/2010/10/11/data-paging-in-flex-4/" target="_blank">data paging</a> to handle large result sets.</p>
<h3>Features</h3>
<p><img class="alignright size-thumbnail wp-image-768" title="query-browser-db-info" src="http://www.smartcode.ch/wp-content/uploads/2011/06/query-browser-db-info1-196x200.png" alt="" width="196" height="200" /></p>
<p>The query browser consists of tree which displays the information about the database, its tables and fields. Auxiliary information such as table size (rows) and field types are shown alongside.</p>
<p>Clicking table or field nodes creates the appropriate  SQL query. For instance, if you wish to get all data from table <code>directors</code>, click on the the table node and a query in the form of <code>SELECT * FROM directors</code>is displayed in the query input.</p>
<p>This is a very simple query builder, so do not expect it to create joins or multi table statements.Queries are validated using a simple <a title="AS3 API documentation for the RegExp class" href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/RegExp.html" target="_blank">Regular Expression</a>, which tests for presence of field and table name. Hence, queries like <code>SELECT 1+1</code>will not validate.</p>
<p><img class="alignnone size-full wp-image-628" title="query-browser-validator" src="http://www.smartcode.ch/wp-content/uploads/2011/12/query-browser-validator.png" alt="" width="680" height="54" /></p>
<p>The query history drop down list offers quick access to previous queries.</p>
<p><img class="alignnone size-full wp-image-631" title="query-browser-history" src="http://www.smartcode.ch/wp-content/uploads/2011/12/query-browser-history.png" alt="" width="680" height="179" /></p>
<p>Results are displayed in a simple <a title="Spark DataGrid API documentation" href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/spark/components/DataGrid.html" target="_blank">Spark Data Grid</a> control. However, the <code>dataProvider</code> for this grid is an <a title="AsyncListView API documentation" href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/collections/AsyncListView.html" target="_blank">AsyncListView</a> wrapping a <a title="PagedList.as" href="https://github.com/jamesward/DataPaging/blob/master/src/PagedList.as" target="_blank">PagedList</a>, which enables data paging for large result sets.</p>
<p><img class="alignnone size-full wp-image-630" title="query-browser-results" src="http://www.smartcode.ch/wp-content/uploads/2011/12/query-browser-results.png" alt="" width="680" height="237" /></p>
<p>Watch the following screencast that demonstrates the features.</p>
<p><a class="fancybox-swf {width:1024,height:675}" href="http://www.smartcode.ch/wp-content/uploads/2011/06/query-browser-screencast.swf"><img class="alignnone size-full wp-image-311" title="query-browser-screencast" src="http://www.smartcode.ch/wp-content/uploads/2011/12/query-browser-screencast.png" alt="" /></a></p>
<h3>Limitations</h3>
<p>Obviously there are a lot of limitations compared to an application like <a title="MySQL Workbench" href="http://wb.mysql.com/" target="_blank">MySQL Workbench</a>. However, I never even thought about getting there.</p>
<p>A remaining limitation is the query of large tables (millions of records) with non-consecutive or without a primary key. In this scenario, I never got around working with the <code>LIMIT</code> clause, which is a real performance killer.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smartcode.ch/blog/flex/flex-4-5-mysql-query-browser/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Create Flex 4.5.* API docs for offline view on Mac OS X</title>
		<link>http://www.smartcode.ch/blog/flex/create-flex-4-5-api-docs-for-offline-view-on-mac-os-x/</link>
		<comments>http://www.smartcode.ch/blog/flex/create-flex-4-5-api-docs-for-offline-view-on-mac-os-x/#comments</comments>
		<pubDate>Mon, 20 Jun 2011 10:15:28 +0000</pubDate>
		<dc:creator>Rico Leuthold</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[docs]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[Flex 4.5]]></category>
		<category><![CDATA[offline]]></category>
		<category><![CDATA[Quicksilver]]></category>

		<guid isPermaLink="false">http://blog.to-fuse.ch/?p=132</guid>
		<description><![CDATA[Even today it seems to be difficult to find a downloadable version of the Flex 4.5 SDK API docs. However, it turned out that it is not that difficult to create a local copy of the API docs using ant. All you need is a copy of a Flex 4.5 SDK, ant and a bit of &#8230; <a href="http://www.smartcode.ch/blog/flex/create-flex-4-5-api-docs-for-offline-view-on-mac-os-x/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Even today it seems to be difficult to find a downloadable version of the <em>Flex 4.5 SDK API</em> docs. However, it turned out that it is not that difficult to create a local copy of the API docs using <em><a title="Apache Ant" href="http://ant.apache.org/" target="_blank">ant</a></em>.</p>
<p>All you need is a copy of a<em> <a title="Flex 4.5 SDK" href="http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4.5" target="_blank">Flex 4.5 SDK</a></em>, <em>ant</em> and a bit of courage to deal with the <a title="OS X Terminal" href="http://en.wikipedia.org/wiki/Apple_Terminal" target="_blank"><em>Terminal</em></a>.</p>
<p>If you are not in a do-it-yourself kind of mood, you can <a title="Flex 4.5.1 API doc download link" href="http://www.smartcode.ch/wp-content/uploads/2011/06/flex-4-5-1-api.zip">download the Flex 4.5.1 API docs</a>.</p>
<p><span id="more-132"></span></p>
<h3>Basic Setup</h3>
<ul>
<li>First of all, if you haven&#8217;t already, grab a copy of the <em><a title="Flex 4.5 SDK" href="http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4.5" target="_blank">Flex 4.5 SDK</a></em> and unzip it.<br />
<img title="Download Flex SDK" src="http://www.smartcode.ch/wp-content/uploads/2011/06/download_flex_sdk.png" alt="" /><br />
<img title="Unzip SDK" src="http://www.smartcode.ch/wp-content/uploads/2011/06/unzip_sdk.png" alt="" /></li>
<li>To install the <em>sdk</em> for use in <em><a title="Flash Builder 4.5" href="www.adobe.com/products/flash-builder.html" target="_blank">Adobe Flash Builder</a></em>, move the <em>sdk</em> folder to the <em>sdks </em>folder of your <em>Flash Builder</em> installation &#8230;<br />
<a rel="lightbox" href="http://www.smartcode.ch/wp-content/uploads/2011/06/move_sdk.png"><img title="Move SDK" src="http://www.smartcode.ch/wp-content/uploads/2011/06/move_sdk_thumb1.png" alt="" /></a>&nbsp;</p>
<p>&#8230; and rename it to something more meaningful like <em>4.5.0</em>.</p>
<p><img class="alignnone size-full wp-image-174" title="Rename SDK" src="http://www.smartcode.ch/wp-content/uploads/2011/06/rename_sdk1.png" alt="" /></li>
<li>Open the <em>Terminal</em> application (using <em>Spotlight</em> or whatever you prefer). In the <em>Terminal</em> window type: <strong>cd</strong> followed by a blank <strong>space</strong>.<br />
<img class="alignnone size-medium wp-image-184" title="Open and prepare Terminal" src="http://www.smartcode.ch/wp-content/uploads/2011/06/open_prepare_terminal.png" alt="" /></li>
<li> Next, open the <strong>4.5.0</strong> folder, drag the <em><strong>asdoc</strong></em> folder to the <em>Terminal</em> and hit <em><strong>Return</strong></em>.<br />
<a rel="lightbox" href="http://www.smartcode.ch/wp-content/uploads/2011/06/drop_sdk_asdoc_terminal.png"><img title="Drag and drop asdoc folder from the Finder to the Terminal window" src="http://www.smartcode.ch/wp-content/uploads/2011/06/drop_sdk_asdoc_terminal_thumb.png" alt="" /></a></li>
<li>Now that we are in the right place, we are ready to build the docs. Type the following command in the terminal window:

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ant -DFLEX_HOME=..<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-lib</span> ..<span style="color: #000000; font-weight: bold;">/</span>ant<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>flexTasks.jar <span style="color: #660033;">-f</span> build.xml</pre></div></div>

<p><a rel="lightbox" href="http://www.smartcode.ch/wp-content/uploads/2011/06/create_docs_using_ant.png"><img title="Create the API docs using ant" src="http://www.smartcode.ch/wp-content/uploads/2011/06/create_docs_using_ant_thumb.png" alt="" /></a></p>
<p>Please note that the process to build the <em>API</em> docs takes some time (almost 7 minutes on my MBP).</p>
<p>If you get an error like:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">-bash: ant: <span style="color: #7a0874; font-weight: bold;">command</span> not found</pre></div></div>

<p>you need to install <em><a href="http://ant.apache.org/">ant</a></em> first. The easiest way to get <em>ant</em> running on your Mac is to install <a title="Xcode" href="http://developer.apple.com/xcode/" target="_blank"><em>Xcode</em></a>.</li>
<li>Upon a sucessful build you will notice a new folder called <em><strong>asdoc-output</strong></em> within your <em>sdk</em> folder.<br />
<a rel="lightbox" href="http://www.smartcode.ch/wp-content/uploads/2011/06/asdoc_output_folder.png"><img title="asdoc-output folder" src="http://www.smartcode.ch/wp-content/uploads/2011/06/asdoc_output_folder_thumb.png" alt="" /></a></li>
<li>Double click the <strong>all-classes.html</strong> file to open it in the browser.<br />
<img title="all-classes.html" src="http://www.smartcode.ch/wp-content/uploads/2011/06/all_classes_file.png" alt="" /><br />
<a rel="lightbox" href="http://www.smartcode.ch/wp-content/uploads/2011/06/all_classes_browser.png"><img title="asdoc-output folder" src="http://www.smartcode.ch/wp-content/uploads/2011/06/all_classes_browser_thumb.png" alt="" /></a></li>
</ul>
<p>That&#8217;s it, create a bookmark for the page and you&#8217;re ready to browse the <em>API</em> docs &#8230;</p>
<p>&#8230; <strong>OR</strong> you make your <em>Flex</em> developer life even easier and read on &#8230;</p>
<h3>Advanced Setup using Quicksilver</h3>
<p><a title="Quicksilver" href="http://qsapp.com/" target="_blank">Quicksilver</a> is an excellent alternative to <em>Mac OS X</em> builtin <em>Spotlight</em> feature. Basically it does the same as <em>Spotlight</em>, but one of the additional features of <em>Quicksilver</em> is the ability to index <em>HTML</em> links within files.</p>
<p>As you might guess, this comes in very handy to have the <em>API</em> docs at your fingertips.</p>
<ul>
<li>Obviously you need to install <a title="Quicksilver" href="http://qsapp.com/" target="_blank">Quicksilver</a>.Some introductory information about <em>Quicksilver</em> is available <a title="Speeding Up OS X Navigation with Quicksilver" href="http://www.howtogeek.com/howto/20528/speeding-up-os-x-navigation-with-quicksilver/" target="_blank">here</a>.</li>
<li>Next, we need to convert the relative links in <strong>all-classes.html</strong> to absolute file links that open in the browser.Meaning links like this one &#8230;

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;mx.containers.Accordion&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;mx/containers/Accordion.html&quot;</span>&gt;</span>Accordion<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span></pre></div></div>

<p>&#8230; should look like this.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;mx.containers.Accordion&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;file:///Applications/Adobe%20Flash%20Builder%204.5/sdks/4.5.0/asdoc-output/mx/containers/Accordion.html&quot;</span>&gt;</span>Accordion<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span></pre></div></div>

<p>I created a <em>Perl</em> script to do this &#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl -w</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">use</span> strict<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> File<span style="color: #339933;">::</span><span style="color: #006600;">Basename</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$FILE</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$FILENAME</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$PATH</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$SUFFIX</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> fileparse<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$FILE</span><span style="color: #339933;">,</span> <span style="color: #009966; font-style: italic;">qr/\.[^.]*/</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">exit</span> <span style="color: #cc66cc;">0</span> <span style="color: #b1b100;">if</span> <span style="color: #0000ff;">$SUFFIX</span> <span style="color: #339933;">!~</span> <span style="color: #009966; font-style: italic;">m/\.html/</span><span style="color: #339933;">;</span>
<span style="color: #000066;">exit</span> <span style="color: #cc66cc;">0</span> <span style="color: #b1b100;">unless</span><span style="color: #009900;">&#40;</span> <span style="color: #339933;">-</span>r <span style="color: #0000ff;">$FILE</span> <span style="color: #0000ff;">&amp;amp</span><span style="color: #339933;">;</span><span style="color: #0000ff;">&amp;amp</span><span style="color: #339933;">;</span> <span style="color: #339933;">-</span>w _ <span style="color: #0000ff;">&amp;amp</span><span style="color: #339933;">;</span><span style="color: #0000ff;">&amp;amp</span><span style="color: #339933;">;</span> <span style="color: #339933;">-</span>f _ <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$FILE_PATH_PREFIX</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'file://'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$CLASS_LINKS_REGEX</span> <span style="color: #339933;">=</span> <span style="color: #009966; font-style: italic;">qr/href=&quot;(.+\.(html|css))&quot;/</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@NEW_LINES</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$PATH</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/\s/%20/g</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>FILE<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;+&amp;lt; $FILE&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;can't open $FILE: $!&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">defined</span><span style="color: #009900;">&#40;</span><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$line</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$line</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">m/$CLASS_LINKS_REGEX/</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$org</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$1</span><span style="color: #339933;">;</span>
	    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$new</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$FILE_PATH_PREFIX</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$PATH</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$1</span><span style="color: #339933;">;</span>
     	    <span style="color: #0000ff;">$line</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/$org/$new/</span><span style="color: #339933;">;</span>
     <span style="color: #009900;">&#125;</span>
     <span style="color: #000066;">push</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@NEW_LINES</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$line</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span>FILE<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>FILE<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;&amp;gt; $FILE&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;can't open $FILE: $!&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> FILE <span style="color: #0000ff;">@NEW_LINES</span><span style="color: #339933;">;</span>
<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span>FILE<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>&#8230; and packed it as an <em>Automator</em> application:</p>
<p><a href="http://www.smartcode.ch/wp-content/uploads/2011/06/prepare_qs_indexing.zip"><img title="automator app to prepare links for indexing" src="http://www.smartcode.ch/wp-content/uploads/2011/06/automator_icon.png" alt="" /></a></p>
<p>Drop your <strong>all-classes.html</strong> file on the application and you&#8217;re done.</li>
<li>Now we need to tell <em>Quicksilver</em> to index the file with its content:Open the <em>Quicksilver</em> preferences and select <strong>Catalog</strong>.<a rel="lightbox" href="http://www.smartcode.ch/wp-content/uploads/2011/06/open-qs-preferences.png"><img title="Open Quicksilver preferences" src="http://www.smartcode.ch/wp-content/uploads/2011/06/open-qs-preferences-thumb.png" alt="" /></a></li>
<li>Select the <strong>Custom</strong> section, add a new <strong>File &amp; Folder Scanner</strong> &#8230;<br />
<img title="Add File &amp; Folder scanner" src="http://www.smartcode.ch/wp-content/uploads/2011/06/add-qs-file.png" alt="" />&nbsp;</p>
<p>&#8230; and select your prepared <strong>all-classes.html</strong> file.</li>
<li>To include the <em>HTML</em> links in the index, open the <strong>info</strong> (marked green ) drawer, select <strong>HTML Links</strong> from the <em>Include Contents</em> drop-down menu and hit the <strong>refresh</strong> button (marked red).<br />
<img title="Include HTML Links" src="http://www.smartcode.ch/wp-content/uploads/2011/06/add-qs-html-links.png" alt="" /></li>
<li> You should notice a markable increase of the indexed elements for your <strong>all-classes.html</strong> entry.<br />
<img title="all-classes-html index" src="http://www.smartcode.ch/wp-content/uploads/2011/06/indexed-qs.png" alt="" /></li>
<li>Here we go &#8211; the <em>API</em> docs at your fingertips. Open <em>Quicksilver</em> and type, for example, <em>Accord</em>. Select the <em>Accordion</em> entry and you get the <em>API</em> for the <em>Accordion</em> class.<br />
<img title="Search for the Accordion class" src="http://www.smartcode.ch/wp-content/uploads/2011/06/search-qs.png" alt="" /><br />
<a rel="lightbox" href="http://www.smartcode.ch/wp-content/uploads/2011/06/api-display-qs.png"><img title="API docs for the Accordion class" src="http://www.smartcode.ch/wp-content/uploads/2011/06/api-display-qs-thumb.png" alt="" /></a></li>
</ul>
<p>I hope everything went well. If not, please leave a comment so that I can try to assist.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smartcode.ch/blog/flex/create-flex-4-5-api-docs-for-offline-view-on-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>miceminer &#8211; a data mining interface to study social behavior of house mice</title>
		<link>http://www.smartcode.ch/uncategorized/miceminer-a-data-mining-interface-to-study-social-behavior-of-house-mice/</link>
		<comments>http://www.smartcode.ch/uncategorized/miceminer-a-data-mining-interface-to-study-social-behavior-of-house-mice/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 16:30:29 +0000</pubDate>
		<dc:creator>Rico Leuthold</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Flex data mining social behavior house mice network visualization birdeye flexlib]]></category>

		<guid isPermaLink="false">http://ricombination.wordpress.com/?p=77</guid>
		<description><![CDATA[I just handed in my master thesis in biology (animal behavior), which consists of a database of spatial position data of a house mice population, and a Flex interface named miceminer to access the database. Unfortunately the application is on a server within the network of the University of Zurich. Therefore I can just offer &#8230; <a href="http://www.smartcode.ch/uncategorized/miceminer-a-data-mining-interface-to-study-social-behavior-of-house-mice/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I just handed in <a href="http://dl.getdropbox.com/u/38483/miceminer_thesis_sans.pdf">my master thesis</a> in biology (animal behavior), which consists of a database of spatial position data of a house mice population, and a Flex interface named <strong>miceminer</strong> to access the database.</p>
<p><a href="http://www.smartcode.ch/wp-content/uploads/2011/12/miceminer.png"><img class="alignnone size-large wp-image-749" title="miceminer" src="http://www.smartcode.ch/wp-content/uploads/2011/12/miceminer-680x426.png" alt="" width="680" height="426" /></a></p>
<p>Unfortunately the application is on a server within the network of the University of Zurich. Therefore I can just offer you a screen-cast that introduces some features:</p>
<ul style="list-style-type: square;">
<li><a href="http://dl.getdropbox.com/u/38483/miceminer.mov" target="_blank">Large version (100 MB)</a></li>
<li><a href="http://dl.getdropbox.com/u/38483/miceminer_mid.mov" target="_blank">Small version (5 MB)</a></li>
</ul>
<p><span id="more-77"></span></p>
<p>The Flex interface intends to support the researchers involved in this project during the data mining process. Since we collected around 11 million datasets so far, I focused on the development of data filters. Here I used a lot of the components offered in the <a href="http://code.google.com/p/flexlib/" target="_blank">flexlib </a> library. A big thank you to the developers.</p>
<p><a href="http://dl.getdropbox.com/u/38483/miceminer_bd.png" target="_blank"><br />
<img src="http://www.smartcode.ch/wp-content/uploads/2009/11/miceminer_bd_small.png" alt="miceminer_bd_small.png" width="350" height="219" align="center" border="0" /><br />
</a><span style="padding-left: 10px; font-size: 10px; color: #afafaf;">Click image for larger size</span></p>
<p>Once the researchers found an interesting set of data they can export it to Excel files. To ensure correct formatting of the Excel output I used the pear package <a href="http://pear.php.net/package/Spreadsheet_Excel_Writer" target="_blank">Spreadsheet_Excel_Writer</a>. This package is mostly a PHP clone of the great perl module called <a href="http://search.cpan.org/dist/Spreadsheet-WriteExcel/" target="_blank">Spreadsheet::WriteExcel</a>.</p>
<p>The second core feature of the application is the visualization of the social network in the mice population that I found processing the spatial position data using <a href="http://github.com/rico/miceminer-perl" target="_blank">several perl scripts</a>. The visualization is based on the excellent open source library <a href="http://code.google.com/p/birdeye/" target="_blank">birdeye</a>. Another big thank to these developers. To the already rich feature set I added options to filter the edges by weight and to calculate some network measures (e.g. <a href="http://en.wikipedia.org/wiki/Clustering_coefficient" target="_blank">clustering coefficient</a>, <a href="http://en.wikipedia.org/wiki/Centrality#Betweenness_centrality" target="_blank">betweeness centrality</a>).</p>
<p><a href="http://dl.getdropbox.com/u/38483/node_based_measures.png" target="_blank"><br />
<img src="http://www.smartcode.ch/wp-content/uploads/2009/11/node_based_measures_small.png" alt="node_based_measures_small.png" width="350" height="148" align="center" border="0" /></a><br />
<span style="padding-left: 10px; font-size: 10px; color: #afafaf;">Click image for larger size</span></p>
<p>The application source code is available as a <a href="http://github.com/rico/miceminer-flex" target="_blank">github repository</a>. Since this was my first Flex project do not expect great code.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smartcode.ch/uncategorized/miceminer-a-data-mining-interface-to-study-social-behavior-of-house-mice/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
<enclosure url="http://dl.getdropbox.com/u/38483/miceminer.mov" length="99336650" type="video/quicktime" />
<enclosure url="http://dl.getdropbox.com/u/38483/miceminer_mid.mov" length="5189754" type="video/quicktime" />
<enclosure url="http://dl.getdropbox.com/u/38483/miceminer.mov" length="99336650" type="video/quicktime" />
		</item>
		<item>
		<title>Flex 3 and Zend_Amf Class Mapping Hint</title>
		<link>http://www.smartcode.ch/blog/flex/flex-3-and-zend_amf-class-mapping-hint/</link>
		<comments>http://www.smartcode.ch/blog/flex/flex-3-and-zend_amf-class-mapping-hint/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 10:41:05 +0000</pubDate>
		<dc:creator>Rico Leuthold</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[ZendAMF]]></category>

		<guid isPermaLink="false">http://ricombination.wordpress.com/?p=66</guid>
		<description><![CDATA[For my latest little Flex project, I used Zend Amf instead of amfphp for remoting. I had no trouble getting started with Zend Amf since I&#8217;m familiar with amfphp and there are good resources available on the web ( e.g. Zend Amf Wiki and Flex and PHP: remoting with Zend AMF ). However, one thing &#8230; <a href="http://www.smartcode.ch/blog/flex/flex-3-and-zend_amf-class-mapping-hint/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>For my latest little Flex project, I used <a href="http://framework.zend.com/manual/en/zend.amf.html">Zend Amf</a> instead of <a href="http://www.amfphp.org/">amfphp</a> for remoting. I had no trouble getting started with Zend Amf since I&#8217;m familiar with amfphp and there are good resources available on the web ( e.g. <a href="http://framework.zend.com/wiki/display/ZFPROP/Zend_Amf+-+Wade+Arnold">Zend Amf Wiki</a> and <a href="http://corlan.org/2008/11/13/flex-and-php-remoting-with-zend-amf/">Flex and PHP: remoting with Zend AMF</a> ).</p>
<p>However, one thing really bugged me. Not all of the class mappings worked as expected. For some of the classes I got general objects back in my Flex application instead of the typed objects. I checked forth and back and couldn&#8217;t find any bug in my code. So I checked the web and found a solution to my problem.  <span id="more-66"></span>First of all, I recommend you to watch the <a href="http://www.wadearnold.com/tutorials/zend/classmap/">screencast</a> created by the lead developer of Zend Amf (Wade Arnold), which shows the different possiblities to set up the class mapping.</p>
<p>That brought me to <a href="http://www.charlesproxy.com/">Charles</a>, with which I could check that the desired class type is really returned by php remote service.</p>
<p>As this was the case, I searched the web for some more information about the class mapping in Flex. Finally I came across <a href="http://www.actionscript.org/forums/showthread.php3?t=196534">this</a> forum thread offering some ideas to make the class mapping work.</p>
<p><a href="http://www.actionscript.org/forums/showpost.php3?p=872508&amp;postcount=8">This</a> answer in the thread helped in my situation.</p>
<p>I added the registration to the <code>creationComplete</code> handler function in my application as follow:</p>
<pre style="border: 1px solid #666666; background-color: #dddddd; padding: 4px;">/**
* Creation complete handler
*/
public function build() {

	// Register remote class mapping
	registerClassAlias( "vo.PublicationVO", PublicationVO);
	registerClassAlias( "vo.MonthlyHitsVO", MonthlyHitsVO);
	registerClassAlias( "vo.DailyHits", DailyHitsVO);
	registerClassAlias( "vo.PageHitsVO", PageHitsVO);
}
</pre>
<p>&#8230; and all the class mappings worked like a charm.</p>
<p>The dcoumentation for the <code> registerClassAlias(aliasName:String, classObject:Class):void</code> method can be found <a href="http://livedocs.adobe.com/flex/3/langref/flash/net/package.html#registerClassAlias()">here</a>.</p>
<p>In my case, the problem was, that I didn&#8217;t used an instance of some of the classes in the Flex app yet, so the class was not compiled into the SWF.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smartcode.ch/blog/flex/flex-3-and-zend_amf-class-mapping-hint/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

