<?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>Freya.no &#187; Dev</title>
	<atom:link href="http://wp.freya.no/tag/dev/feed/" rel="self" type="application/rss+xml" />
	<link>http://wp.freya.no</link>
	<description>Knowledge is power</description>
	<lastBuildDate>Mon, 06 Feb 2012 19:56:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Failed to emerge media-gfx/imagemagick-6.7.1.0</title>
		<link>http://wp.freya.no/2011/09/failed-to-emerge-media-gfximagemagick-6-7-1-0/</link>
		<comments>http://wp.freya.no/2011/09/failed-to-emerge-media-gfximagemagick-6-7-1-0/#comments</comments>
		<pubDate>Fri, 02 Sep 2011 08:46:16 +0000</pubDate>
		<dc:creator>kent</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[emerge]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://wp.freya.no/?p=1048</guid>
		<description><![CDATA[If you&#8217;ve upgraded Perl on your Gentoo box to 5.12, and tries to reemerge ImageMagick, you might get this error: Reemerge with: After some minutes: You might also want to update /etc/portage/package.use with &#8220;media-gfx/imagemagick -perl&#8221; if you don&#8217;t need Perl with ImageMagick. No related posts.
No related posts.]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve upgraded Perl on your Gentoo box to 5.12, and tries to reemerge ImageMagick, you might get this error:</p>
<pre class="brush: plain; title: ; notranslate">Could not find a typemap for C type 'Image::Magick' in Magick.xs, line 2404
make[3]: *** [Magick.c] Error 1
make[3]: Leaving directory `/var/tmp/portage/media-gfx/imagemagick-6.7.1.0/work/ImageMagick-6.7.1-0/PerlMagick'
make[2]: *** [install-exec-perl] Error 2
make[2]: Leaving directory `/var/tmp/portage/media-gfx/imagemagick-6.7.1.0/work/ImageMagick-6.7.1-0'
make[1]: *** [install-am] Error 2
make[1]: Leaving directory `/var/tmp/portage/media-gfx/imagemagick-6.7.1.0/work/ImageMagick-6.7.1-0'
make: *** [install] Error 2
 * ERROR: media-gfx/imagemagick-6.7.1.0 failed (install phase):
 *   emake failed
 *
 * If you need support, post the output of 'emerge --info =media-gfx/imagemagick-6.7.1.0',
 * the complete build log and the output of 'emerge -pqv =media-gfx/imagemagick-6.7.1.0'.
 * The complete build log is located at '/var/tmp/portage/media-gfx/imagemagick-6.7.1.0/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/media-gfx/imagemagick-6.7.1.0/temp/environment'.
 * S: '/var/tmp/portage/media-gfx/imagemagick-6.7.1.0/work/ImageMagick-6.7.1-0'

&gt;&gt;&gt; Failed to emerge media-gfx/imagemagick-6.7.1.0, Log file:

&gt;&gt;&gt;  '/var/tmp/portage/media-gfx/imagemagick-6.7.1.0/temp/build.log'
</pre>
<p>Reemerge with:</p>
<pre class="brush: plain; title: ; notranslate"> # USE=&quot;-perl&quot; emerge -av imagemagick

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N     ] media-gfx/imagemagick-6.7.1.0  USE=&quot;bzip2 corefonts cxx jpeg openmp png tiff truetype xml zlib -X -autotrace -djvu -fftw -fontconfig -fpx -graphviz -gs -hdri -jbig -jpeg2k -lcms -lqr -lzma -opencl -openexr -perl -q32 -q64 -q8 -raw -static-libs -svg -webp -wmf&quot; 0 kB

Total: 1 package (1 new), Size of downloads: 0 kB

Would you like to merge these packages? [Yes/No] </pre>
<p>After some minutes:</p>
<pre class="brush: plain; title: ; notranslate">
&gt;&gt;&gt; Recording media-gfx/imagemagick in &quot;world&quot; favorites file...
&gt;&gt;&gt; Auto-cleaning packages...

&gt;&gt;&gt; No outdated packages were found on your system.

 * GNU info directory index is up-to-date.
</pre>
<p>You might also want to update /etc/portage/package.use with &#8220;media-gfx/imagemagick -perl&#8221; if you don&#8217;t need Perl with ImageMagick.</p>
 <img src="http://wp.freya.no/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1048" width="1" height="1" style="display: none;" /><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwp.freya.no%2F2011%2F09%2Ffailed-to-emerge-media-gfximagemagick-6-7-1-0%2F&amp;title=Failed%20to%20emerge%20media-gfx%2Fimagemagick-6.7.1.0" id="wpa2a_6"><img src="http://wp.freya.no/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://wp.freya.no/2011/09/failed-to-emerge-media-gfximagemagick-6-7-1-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Management wizdom</title>
		<link>http://wp.freya.no/2011/03/management-wizdom/</link>
		<comments>http://wp.freya.no/2011/03/management-wizdom/#comments</comments>
		<pubDate>Wed, 09 Mar 2011 20:38:49 +0000</pubDate>
		<dc:creator>kent</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://wp.freya.no/?p=999</guid>
		<description><![CDATA[From TDWTF. Inept management hires inept arrogant conceited glory hogging twit Inept management promotes twit at twit&#8217;s urging Twit hires more twits for personal gain Twit blames remaining competant workers for downward spiral Remaining competant worker leaves Company does well-deserved tail spin, crashes and burns No related posts.
No related posts.]]></description>
			<content:encoded><![CDATA[<p><a href="http://thedailywtf.com/Comments/The-Speed-of-Code.aspx#340315" target="_blank">From TDWTF</a>.</p>
<blockquote><p>Inept management hires inept arrogant conceited glory hogging twit</p>
<p>Inept management promotes twit at twit&#8217;s urging</p>
<p>Twit hires more twits for personal gain</p>
<p>Twit blames remaining competant workers for downward spiral</p>
<p>Remaining competant worker leaves</p>
<p>Company does well-deserved tail spin, crashes and burns</p></blockquote>
 <img src="http://wp.freya.no/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=999" width="1" height="1" style="display: none;" /><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwp.freya.no%2F2011%2F03%2Fmanagement-wizdom%2F&amp;title=Management%20wizdom" id="wpa2a_14"><img src="http://wp.freya.no/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://wp.freya.no/2011/03/management-wizdom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to get a value of mx:DataGridColumn</title>
		<link>http://wp.freya.no/2011/02/how-to-get-a-value-of-mxdatagridcolumn/</link>
		<comments>http://wp.freya.no/2011/02/how-to-get-a-value-of-mxdatagridcolumn/#comments</comments>
		<pubDate>Mon, 28 Feb 2011 20:23:42 +0000</pubDate>
		<dc:creator>Tatyana</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://wp.freya.no/?p=987</guid>
		<description><![CDATA[No related posts.
No related posts.]]></description>
			<content:encoded><![CDATA[<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:DataGrid xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;&gt;
    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.controls.Label;

            public function willShowResult(result:Label, myVar:String):Boolean {
                if (myVar== 'XXX') {
                    return false;
                }
                return true;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:columns&gt;
        &lt;mx:DataGridColumn
            dataField=&quot;myVar&quot;
            headerText=&quot;My var&quot;/&gt;
        &lt;mx:DataGridColumn
            dataField=&quot;result&quot;
            headerText=&quot;My result&quot;&gt;
            &lt;mx:itemRenderer&gt;
                &lt;mx:Component&gt;
                    &lt;mx:Label text=&quot;{outerDocument.willShowResult(this, data.myVar) ? data.result : ' ' }&quot;/&gt;
                &lt;/mx:Component&gt;
            &lt;/mx:itemRenderer&gt;
        &lt;/mx:DataGridColumn&gt;
    &lt;/mx:columns&gt;

&lt;/mx:DataGrid&gt;
</pre>
 <img src="http://wp.freya.no/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=987" width="1" height="1" style="display: none;" /><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwp.freya.no%2F2011%2F02%2Fhow-to-get-a-value-of-mxdatagridcolumn%2F&amp;title=How%20to%20get%20a%20value%20of%20mx%3ADataGridColumn" id="wpa2a_22"><img src="http://wp.freya.no/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://wp.freya.no/2011/02/how-to-get-a-value-of-mxdatagridcolumn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse autocomplete problem</title>
		<link>http://wp.freya.no/2011/02/eclipse-autocomplete-problem/</link>
		<comments>http://wp.freya.no/2011/02/eclipse-autocomplete-problem/#comments</comments>
		<pubDate>Mon, 28 Feb 2011 14:17:44 +0000</pubDate>
		<dc:creator>Tatyana</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Tip]]></category>
		<category><![CDATA[Dev]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://wp.freya.no/?p=983</guid>
		<description><![CDATA[If an autocomplete stopped working go Window -&#62; Preferences -&#62; Java -&#62; Editor -&#62; Content Assist -&#62; Advanced -&#62;  check for &#8220;Other Java Proposals&#8221; No related posts.
No related posts.]]></description>
			<content:encoded><![CDATA[<p>If an autocomplete stopped working go</p>
<p>Window -&gt; Preferences -&gt; Java -&gt; Editor -&gt; Content Assist -&gt; Advanced -&gt;  check for &#8220;Other Java Proposals&#8221;</p>
 <img src="http://wp.freya.no/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=983" width="1" height="1" style="display: none;" /><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwp.freya.no%2F2011%2F02%2Feclipse-autocomplete-problem%2F&amp;title=Eclipse%20autocomplete%20problem" id="wpa2a_30"><img src="http://wp.freya.no/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://wp.freya.no/2011/02/eclipse-autocomplete-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PMD XPath: Hibernate mapping example</title>
		<link>http://wp.freya.no/java/pmd-xpath-hibernate-mapping-example/</link>
		<comments>http://wp.freya.no/java/pmd-xpath-hibernate-mapping-example/#comments</comments>
		<pubDate>Mon, 25 Oct 2010 20:13:08 +0000</pubDate>
		<dc:creator>Tatyana</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[pmd]]></category>
		<category><![CDATA[xpath]]></category>

		<guid isPermaLink="false">http://wp.freya.no/?p=879</guid>
		<description><![CDATA[Those who use hibernate for database access know that you need to provide an information that this object is a hibernate object. To do so you typically need to annotate your object with @Entity. It&#8217;s not a problem although if we speak about some large system. In large systems we have typically a number of [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>Those who use hibernate for database access know that you need to provide an information that this object is a hibernate object. To do so you typically need to annotate your object with @Entity. It&#8217;s not a problem although if we speak about some large system. In large systems we have typically a number of instances of the same object that represent the same table in different contexts and packages. And here we need this: to give each object unique name.<br />
Example:</p>
<pre class="brush: java; title: ; notranslate">
@Entity(name=&quot;person.usa&quot;)
class Person {
   ...
}
</pre>
<p>This PMD rule shows how to check if a hibernate object have a name.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;![CDATA[
     //Annotation/NormalAnnotation[
     (
           Name/@Image='Entity'
           and
           not
           (
                 MemberValuePairs/MemberValuePair/@Image='name'
                 and
                 //PrimaryExpression/PrimaryPrefix[contains(Literal/@Image,'.')]
           )
     )
]]]&gt;
</pre>
 <img src="http://wp.freya.no/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=879" width="1" height="1" style="display: none;" /><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwp.freya.no%2Fjava%2Fpmd-xpath-hibernate-mapping-example%2F&amp;title=PMD%20XPath%3A%20Hibernate%20mapping%20example" id="wpa2a_38"><img src="http://wp.freya.no/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://wp.freya.no/java/pmd-xpath-hibernate-mapping-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Return empty objects, not nulls</title>
		<link>http://wp.freya.no/2010/10/return-empty-objects-not-nulls/</link>
		<comments>http://wp.freya.no/2010/10/return-empty-objects-not-nulls/#comments</comments>
		<pubDate>Sun, 17 Oct 2010 19:14:51 +0000</pubDate>
		<dc:creator>Tatyana</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[clean code]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://wp.freya.no/?p=861</guid>
		<description><![CDATA[It&#8217;s uncommon to see methods like this> There is no reason to make a Person object where there are no persons found. But doing so requires extra code in the client to handle the null value. This becomes a problem if a client is, for example, a GUI: The result of such code in cases [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s uncommon to see methods like this></p>
<pre class="brush: java; title: ; notranslate">
public Person findPerson() {
   if(someService) [
     return someService.getPerson();
   }
   return null;
}
</pre>
<p>There is no reason to make a Person object where there are no persons found. But doing so requires extra code in the client to handle the null value. This becomes a problem if a client is, for example, a GUI:</p>
<pre class="brush: java; title: ; notranslate">
somePage.jsp
&lt;%
  ...
  Person person = myService.findPerson();
%&gt;
&lt;table&gt;
   &lt;tr&gt;
      &lt;td&gt;${person.name}&lt;/td&gt;
      &lt;td&gt;${person.address}&lt;/td&gt;
      &lt;td&gt;${person.numberOfPurchases}&lt;/td&gt;
   &lt;/tr&gt;
&lt;/table&gt;
</pre>
<p>The result of such code in cases where the person cannot be found is Server error. So,<strong> there is no reason ever to return <em>null </em>from an object-valued method instead of returning an empty object.</strong> Especially if you deal with arrays and collections.</p>
 <img src="http://wp.freya.no/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=861" width="1" height="1" style="display: none;" /><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwp.freya.no%2F2010%2F10%2Freturn-empty-objects-not-nulls%2F&amp;title=Return%20empty%20objects%2C%20not%20nulls" id="wpa2a_46"><img src="http://wp.freya.no/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://wp.freya.no/2010/10/return-empty-objects-not-nulls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visual Studio: fatal error LNK1201: error writing to program database &#8216;&#8230;&#8217; check for insufficient disk space, invalid path, or insufficient privilege</title>
		<link>http://wp.freya.no/2010/08/visual-studio-fatal-error-lnk1201-error-writing-to-program-database-check-for-insufficient-disk-space-invalid-path-or-insufficient-privilege/</link>
		<comments>http://wp.freya.no/2010/08/visual-studio-fatal-error-lnk1201-error-writing-to-program-database-check-for-insufficient-disk-space-invalid-path-or-insufficient-privilege/#comments</comments>
		<pubDate>Mon, 16 Aug 2010 12:15:04 +0000</pubDate>
		<dc:creator>kent</dc:creator>
				<category><![CDATA[c++]]></category>
		<category><![CDATA[Dev]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://wp.freya.no/?p=810</guid>
		<description><![CDATA[When I get this error, it&#8217;s always because I&#8217;ve opened the debugging process in Process Explorer. Close the handle in Process Explorer or restart Process Explorer. No related posts.
No related posts.]]></description>
			<content:encoded><![CDATA[<p>When I get this error, it&#8217;s always because I&#8217;ve opened the debugging process in Process Explorer.</p>
<pre class="brush: plain; title: ; notranslate">Error    1    fatal error LNK1201: error writing to program database 'e:\blergh\blergh\bin\blergh_d.pdb'; check for insufficient disk space, invalid path, or insufficient privilege</pre>
<p>Close the handle in Process Explorer or restart Process Explorer.</p>
 <img src="http://wp.freya.no/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=810" width="1" height="1" style="display: none;" /><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwp.freya.no%2F2010%2F08%2Fvisual-studio-fatal-error-lnk1201-error-writing-to-program-database-check-for-insufficient-disk-space-invalid-path-or-insufficient-privilege%2F&amp;title=Visual%20Studio%3A%20fatal%20error%20LNK1201%3A%20error%20writing%20to%20program%20database%20%26%238216%3B%26%238230%3B%26%238217%3B%20check%20for%20insufficient%20disk%20space%2C%20invalid%20path%2C%20or%20insufficient%20privilege" id="wpa2a_54"><img src="http://wp.freya.no/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://wp.freya.no/2010/08/visual-studio-fatal-error-lnk1201-error-writing-to-program-database-check-for-insufficient-disk-space-invalid-path-or-insufficient-privilege/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex: force focus on parent change</title>
		<link>http://wp.freya.no/flash-flex/flex-force-focus-on-parent-change/</link>
		<comments>http://wp.freya.no/flash-flex/flex-force-focus-on-parent-change/#comments</comments>
		<pubDate>Sat, 24 Jul 2010 08:36:05 +0000</pubDate>
		<dc:creator>Tatyana</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[howto]]></category>

		<guid isPermaLink="false">http://wp.freya.no/?p=743</guid>
		<description><![CDATA[I was trying to solve a problem of resetting a focus if the parent changes. I had different buttons that show the same .mxml-form but with different data. The problem was that I needed the focus to be on the first date-field whenever the form is shown so that the user can begin typing data [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>I was trying to solve a problem of resetting a focus if the parent changes. I had different buttons that show the same .mxml-form but with different data. The problem was that I needed the focus to be on the first date-field whenever the form is shown so that the user can begin typing data right away.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;mx:HBox&gt;
       &lt;mx:Button id=&quot;noData&quot; click=&quot;showPanelWithNoData()&quot; /&gt;
       &lt;mx:Button id=&quot;someData&quot; click=&quot;showPanelWithSomeData()&quot; /&gt;
       &lt;mx:Button id=&quot;withData&quot; click=&quot;showPanelWithData()&quot; /&gt;

       &lt;myCustomForm:DataForm width=&quot;100%&quot; /&gt;
&lt;/mx:HBox&gt;
</pre>
<p>So for each time one of the buttons is pushed I need the focus to be on myDate-field. To solve the problem I used &#8220;<strong>updateComplete</strong>&#8220;-property of the field.</p>
<p>DataForm.mxml</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;DataForm
    xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;&gt;
    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.managers.FocusManager;

            private function resetFocus():void {
                if (focusManager != null &amp;&amp; myDate.focusManager != null) {
                    focusManager.setFocus(myDate);
                }
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:FormItem&gt;
        &lt;mx:TextField id=&quot;myDate&quot;
            updateComplete=&quot;resetFocus()&quot;/&gt;
    &lt;/mx:FormItem&gt;

&lt;/DataForm&gt;
</pre>
 <img src="http://wp.freya.no/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=743" width="1" height="1" style="display: none;" /><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwp.freya.no%2Fflash-flex%2Fflex-force-focus-on-parent-change%2F&amp;title=Flex%3A%20force%20focus%20on%20parent%20change" id="wpa2a_62"><img src="http://wp.freya.no/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://wp.freya.no/flash-flex/flex-force-focus-on-parent-change/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recipe for a high-quality &#8220;equals&#8221; method</title>
		<link>http://wp.freya.no/java/recipe-for-a-high-quality-equals-method/</link>
		<comments>http://wp.freya.no/java/recipe-for-a-high-quality-equals-method/#comments</comments>
		<pubDate>Sat, 17 Apr 2010 21:49:25 +0000</pubDate>
		<dc:creator>Tatyana</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Memorable]]></category>
		<category><![CDATA[Tip]]></category>
		<category><![CDATA[equals]]></category>
		<category><![CDATA[howto]]></category>

		<guid isPermaLink="false">http://wp.freya.no/?p=675</guid>
		<description><![CDATA[1. Use the == to check if the argument is a reference to this object. 2. Use the instanceof operator to check if the argument has the correct type. 3. Cast the argument to the correct type. 4. For each &#8220;significant&#8221; field in the class, check if that field of the argument matches the corresponding [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>1. Use the == to check if the argument is a reference to this object.</p>
<p>2. Use the <em>instanceof </em>operator to check if the argument has the correct type.</p>
<p>3. Cast the argument to the correct type.</p>
<p>4. For each &#8220;significant&#8221; field in the class, check if that field of the argument matches the corresponding field of this object.</p>
<p>5. Always override <em>hashCode </em>when you override <em>equals</em>.</p>
<p>6. Don&#8217;t substitute another type for Object in the equals declaration.</p>
<p>7. Write unit-test.</p>
<pre class="brush: java; title: ; notranslate">
   @Override
   public boolean equals(Object obj) {
      if(obj == this) {
         return true;
      }
      if(!(obj instanceof Person)) {
          return false;
      }
      Person p = (Person)obj;
      return p.name.equals(name)
             p.birthday.equals(birthday)
             p.personNumber == personNumber;
      }
</pre>
<p><em><br />
Ref.&#8221;Effective Java&#8221; by Joshua Bloch</em></p>
<p>Enother example with hashCode and toString:</p>
<pre class="brush: java; title: ; notranslate">
    @Override
    public boolean equals(Object obj) {
        if (obj == null || !obj.getClass().isInstance(this)) {
            return false;
        }
        Beregning b = (Beregning) obj;

        return new EqualsBuilder()
                .append(simulertPensjon, b.getSimulertPensjon())
                .append(linjer.size(), b.getLinjer().size()).isEquals();
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder().append(simulertPensjon).append(linjer).hashCode();
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
        .append(&quot;simulertPensjon&quot;, simulertPensjon)
        .append(&quot;antall linjer&quot;, linjer.size()).toString();
    }
</pre>
 <img src="http://wp.freya.no/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=675" width="1" height="1" style="display: none;" /><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwp.freya.no%2Fjava%2Frecipe-for-a-high-quality-equals-method%2F&amp;title=Recipe%20for%20a%20high-quality%20%26%238220%3Bequals%26%238221%3B%20method" id="wpa2a_70"><img src="http://wp.freya.no/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://wp.freya.no/java/recipe-for-a-high-quality-equals-method/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EJB 3.0 Roles</title>
		<link>http://wp.freya.no/2010/03/ejb-3-0-roles/</link>
		<comments>http://wp.freya.no/2010/03/ejb-3-0-roles/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 19:14:18 +0000</pubDate>
		<dc:creator>Tatyana</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[certification]]></category>
		<category><![CDATA[Dev]]></category>
		<category><![CDATA[ejb]]></category>
		<category><![CDATA[ejb3]]></category>

		<guid isPermaLink="false">http://wp.freya.no/?p=619</guid>
		<description><![CDATA[I had some difficult time understanding all the roles regarding EJB3. Here is an easy-to-remember description of these roles that I found here. Imagine a factory producing computers: Bean Provider: Chip manufacturer. On the chip, there will be a label with &#8220;Warranty void if removed&#8221; the chip has the logic and the label sets a [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>I had some difficult time understanding all the roles regarding EJB3. Here is an easy-to-remember description of these roles that I found <a href="http://www.coderanch.com/t/485260/EJB-Certification-SCBCD/certification/EJB-roles">here</a>.</p>
<p>Imagine a factory producing computers:</p>
<p><strong>Bean Provider: </strong><br />
Chip manufacturer. On the chip, there will be a label with  &#8220;Warranty void if removed&#8221; the chip has the logic and the label sets a  Role. If you are not authorized to repair it, warranty voids. (i.e. you  cannot access the internal chip if you are not in the role of &#8220;Warranty  Repair Person&#8221;.)</p>
<p><strong>Application Assembler</strong><br />
Mainboard assembler. It takes various chips and puts them on the  mainboard. If any additional resistor or cable are required, it will put  everything togheter to have something that is some kind of working unit  but requires additional assembling.</p>
<p><strong>EJB Server Provider</strong><br />
The EJB Server provider is the Computer Case manufacturer providing  a case with a power supply. Is a container for the mainboard</p>
<p><strong>Deployer</strong><br />
As every computer case is different and power voltage vary country  by country, the Deployer makes sure to adapt the mainboard to the  working environment. In this case adjusts the Voltage on the power  supply, and connects the cables. At the same time he will define who are  the person allowed to repair it (i.e. provide a list of authorized  repair centers)</p>
<p><strong>Persistence Provider</strong><br />
the persistence provider could be the network card company that  provides the driver to connect to a network.</p>
<p><strong>System Administrator</strong><br />
Is the person in charge to install the operating system and do  necessary configuration changes to the OS to connect to the server, and  will make sure to monitor that everything is working fine.</p>
<p>More about Enterprise Java Beans 3.0 and Sun Certified Business Component Developer (SCBCD) certification <a href="http://tatyana.freya.no/scbcd/">here</a>.</p>
 <img src="http://wp.freya.no/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=619" width="1" height="1" style="display: none;" /><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwp.freya.no%2F2010%2F03%2Fejb-3-0-roles%2F&amp;title=EJB%203.0%20Roles" id="wpa2a_78"><img src="http://wp.freya.no/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://wp.freya.no/2010/03/ejb-3-0-roles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

