<?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>blog.joaomorais.com &#187; Papers</title>
	<atom:link href="http://blog.joaomorais.com/category/papers/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.joaomorais.com</link>
	<description>Blog about software development, personal projects and development tools.</description>
	<lastBuildDate>Mon, 10 Apr 2017 02:26:40 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>How to force a view to load other modules languages into SUGAR.language?</title>
		<link>http://blog.joaomorais.com/how-to-force-a-view-to-load-other-modules-languages-into-sugar-language/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-force-a-view-to-load-other-modules-languages-into-sugar-language</link>
		<comments>http://blog.joaomorais.com/how-to-force-a-view-to-load-other-modules-languages-into-sugar-language/#comments</comments>
		<pubDate>Sat, 26 May 2012 18:27:33 +0000</pubDate>
		<dc:creator>João Morais</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Papers]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[SugarCRM]]></category>
		<category><![CDATA[SugarCRM 6.x]]></category>
		<category><![CDATA[Views]]></category>

		<guid isPermaLink="false">http://blog.joaomorais.com/?p=1030</guid>
		<description><![CDATA[As you should know each SugarCRM view extends SugarView class which has a nifty method called _displayJavascript()  who is responsible for including all needed JavaScript files. When it comes to labels, by default, this function only loads current module labels into SUGAR.language. These labels are acessible through the following command: SUGAR.language.get('&#60;ModuleName&#62;', 'LBL_&#60;LabelName&#62;'); In order to add [...]]]></description>
				<content:encoded><![CDATA[<p><img class="alignright  wp-image-1026" title="SugarCRM" alt="SugarCRM" src="http://blog.joaomorais.com/wp-content/uploads/2012/05/sugarCRM-logo.jpg" width="229" height="110" />As you should know each <a title="SugarCRM" href="http://www.sugarcrm.com/" target="_blank">SugarCRM</a> view extends SugarView class which has a nifty method called _displayJavascript()  who is responsible for including all needed JavaScript files.</p>
<p>When it comes to labels, by default, this function only loads current module labels into SUGAR.language.</p>
<p><span id="more-1030"></span>These labels are acessible through the following command:</p>
<pre class="brush:js">SUGAR.language.get('&lt;ModuleName&gt;', 'LBL_&lt;LabelName&gt;');</pre>
<p>In order to add support to other module labels to be included, you should override _displayJavascript() method in your modules view, and specify which other modules labels should be included.</p>
<pre class="brush:php">// modules/&lt;ModuleName&gt;/views/view.edit.php

require_once 'include/MVC/View/views/view.edit.php';

class &lt;ModuleName&gt;ViewEdit extends ViewEdit
{
    protected function _displayJavascript()
    {
        parent::_displayJavascript();

        if (!$this-&gt;_getOption('show_javascript')) {
            return;
        }

        $modules = array(
            '&lt;Module1Name&gt;',
            '&lt;Module2Name&gt;',
        );

        foreach ($modules as $module) {
            if (!is_file($GLOBALS['sugar_config']['cache_dir'] . 'jsLanguage/' . $module . '/' . $GLOBALS['current_language'] . '.js')) {
                require_once 'include/language/jsLanguage.php';
                jsLanguage::createModuleStringsCache($module, $GLOBALS['current_language']);
            }
            echo '&lt;script type="text/javascript" src="' . $GLOBALS['sugar_config']['cache_dir'] . 'jsLanguage/' . $module . '/' . $GLOBALS['current_language'] . '.js?s=' . $GLOBALS['js_version_key'] . '&amp;c=' . $GLOBALS['sugar_config']['js_custom_version'] . '&amp;j=' . $GLOBALS['sugar_config']['js_lang_version'] . '"&gt;&lt;/script&gt;';
        }
    }
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.joaomorais.com/how-to-force-a-view-to-load-other-modules-languages-into-sugar-language/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to reset field values on bean duplication?</title>
		<link>http://blog.joaomorais.com/how-to-reset-field-values-on-bean-duplication/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-reset-field-values-on-bean-duplication</link>
		<comments>http://blog.joaomorais.com/how-to-reset-field-values-on-bean-duplication/#comments</comments>
		<pubDate>Sat, 26 May 2012 17:58:14 +0000</pubDate>
		<dc:creator>João Morais</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Papers]]></category>
		<category><![CDATA[Bean]]></category>
		<category><![CDATA[SugarCRM]]></category>
		<category><![CDATA[SugarCRM 6.x]]></category>
		<category><![CDATA[Views]]></category>

		<guid isPermaLink="false">http://blog.joaomorais.com/?p=1008</guid>
		<description><![CDATA[What you need to do is inject some logic to clear selected field values before the view is displayed. Like all other stuff made in SugarCRM, this process also depends on what type of module you&#8217;re hacking, in other words, the place where you&#8217;re going to write the logic depends if you&#8217;re hacking a custom [...]]]></description>
				<content:encoded><![CDATA[<p><img class="alignright  wp-image-1026" title="SugarCRM" alt="SugarCRM" src="http://blog.joaomorais.com/wp-content/uploads/2012/05/sugarCRM-logo.jpg" width="229" height="110" />What you need to do is inject some logic to clear selected field values before the view is displayed.</p>
<p>Like all other stuff made in <a title="SugarCRM" href="http://www.sugarcrm.com/" target="_blank">SugarCRM</a>, this process also depends on what type of module you&#8217;re hacking, in other words, the place where you&#8217;re going to write the logic depends if you&#8217;re hacking a custom module or a core one.</p>
<p><span id="more-1008"></span>Before you perform view customizations on core modules you should check first if the view is already implemented, in this case, you should check if the following file exists:</p>
<pre class="brush:shell">modules/&lt;ModuleName&gt;/views/view.edit.php</pre>
<p>If so, you should create a new file on:</p>
<pre class="brush:shell">custom/modules/&lt;ModuleName&gt;/views/view.edit.php</pre>
<p>and add further customizations.</p>
<p>Beware that on latest <a title="SugarCRM" href="http://www.sugarcrm.com/" target="_blank">SugarCRM</a> versions, you&#8217;re able to create custom views without having to copy all the logic from the core ones, and by that I mean that now you&#8217;re able to &#8220;truly&#8221; extend the custom views from the latter.</p>
<p>In order to achieve this the view name should be prefixed with &#8216;Custom&#8217;:</p>
<div>
<pre class="brush:php">// custom/modules/&lt;ModuleName&gt;/views/view.edit.php

require_once 'modules/&lt;ModuleName&gt;/views/view.edit.php

class Custom&lt;ModuleName&gt;ViewEdit extends &lt;ModuleName&gt;ViewEdit {
    /** 
     * ...
     */
}</pre>
</div>
<p>If by instance you&#8217;re hacking a core module that doesn&#8217;t have the view defined, you should create it like the example above but with a few differences:</p>
<pre class="brush:php">// custom/modules/&lt;ModuleName&gt;/views/view.edit.php

require_once 'include/MVC/View/views/view.edit.php';

class Custom&lt;ModuleName&gt;ViewEdit extends ViewEdit {
    /** 
     * ...
     */
}</pre>
<p>One thing to keep in mind is that if you&#8217;re hacking a custom module, you are able to choose which directory suits you best. As opposite to the examples above, on the example below, the logic is written directly on the module main folder.</p>
<pre class="brush:php">// modules/&lt;ModuleName&gt;/views/view.edit.php

require_once 'include/MVC/View/views/view.edit.php';

class &lt;ModuleName&gt;ViewEdit extends ViewEdit
{
    public function display()
    {
        $this-&gt;_processDuplicate();
        parent::display();
    }

    /**
     * How bean will act on edit view when it's being duplicated.
     */
    protected function _processDuplicate()
    {
        if ($this-&gt;ev-&gt;isDuplicate) {
            $this-&gt;bean-&gt;&lt;FieldName&gt; = '';
        }
    }
}</pre>
<p>Thanks to Jeff Bickart of <a title="Nepo Systems" href="http://www.neposystems.com/" target="_blank">Nepo Systems</a> and Matthew Poer of <a title="Profiling Solutions" href="http://www.profilingsolutions.com" target="_blank">Profiling Solutions</a> for pointing the &#8220;truly&#8221; Custom views feature out.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.joaomorais.com/how-to-reset-field-values-on-bean-duplication/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Date conversions with strtotime</title>
		<link>http://blog.joaomorais.com/date-conversions-with-strtotime/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=date-conversions-with-strtotime</link>
		<comments>http://blog.joaomorais.com/date-conversions-with-strtotime/#comments</comments>
		<pubDate>Sat, 19 May 2012 08:52:52 +0000</pubDate>
		<dc:creator>João Morais</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Papers]]></category>

		<guid isPermaLink="false">http://blog.joaomorais.com/?p=988</guid>
		<description><![CDATA[At times, while developing custom features in projects there&#8217;s a need to make date conversions. Usually people tend to use strotime() indiscriminately, without being aware of its limitations. Although it is an awesome function, it needs to be used with care, otherwise it may lead to unexpected behaviors. Below there&#8217;s a list of notes, also available in the [...]]]></description>
				<content:encoded><![CDATA[<p><a href="www.php.net"><img class="size-thumbnail wp-image-1004 alignright" title="PHP" src="http://blog.joaomorais.com/wp-content/uploads/2012/05/php-logo-150x150.jpg" alt="PHP" width="150" height="150" /></a>At times, while developing custom features in projects there&#8217;s a need to make date conversions.</p>
<p style="text-align: justify;">Usually people tend to use <a title="strtotime() on PHP Manual" href="http://www.php.net/strtotime" target="_blank">strotime()</a> indiscriminately, without being aware of its limitations. Although it is an awesome function, it needs to be used with care, otherwise it may lead to unexpected behaviors.</p>
<p style="text-align: justify;"><span id="more-988"></span>Below there&#8217;s a list of notes, also available in the <a title="strtotime() on PHP Manual" href="http://www.php.net/strtotime" target="_blank">PHP documentation</a>, that everyone should keep in mind before using this function:</p>
<p style="text-align: justify;">If the number of the <strong>year is specified in a two digit format</strong>, the<strong> values between 00-69 are mapped to 2000-2069 and 70-99 to 1970-1999</strong>. See the notes below for <strong>possible differences on 32bit systems</strong> (possible dates might end on 2038-01-19 03:14:07).</p>
<p style="text-align: justify;">The <strong>valid range of a timestamp</strong> is typically from <strong>Fri, 13 Dec 1901 20:45:54 UTC to Tue, 19 Jan 2038 03:14:07 UTC</strong>. (These are the dates that correspond to the minimum and maximum values for a 32-bit signed integer.) Additionally, not all platforms support negative timestamps, therefore your date range may be limited to no earlier than the Unix epoch. This means that e.g. dates prior to Jan 1, 1970 will not work on Windows, some Linux distributions, and a few other operating systems. PHP 5.1.0 and newer versions overcome this limitation though. <strong>For 64-bit versions of PHP, the valid range of a timestamp is effectively infinite</strong>, as 64 bits can represent approximately 293 billion years in either direction.</p>
<p style="text-align: justify;"><strong>Dates in the m/d/y or d-m-y formats</strong> are disambiguated by looking at the separator between the various components: <strong>if the separator is a slash (/), then the American m/d/y is assumed; whereas if the separator is a dash (-) or a dot (.)</strong>, then the European d-m-y format is assumed. To avoid potential ambiguity, <strong>it&#8217;s best to use ISO 8601 (YYYY-MM-DD) dates or</strong> <a title="DateTime::createFromFormat() on PHP Manual" href="http://www.php.net/manual/en/datetime.createfromformat.php" target="_blank">DateTime::createFromFormat()</a> when possible.</p>
<p style="text-align: justify;">Using this function <strong>for mathematical operations is not advisable</strong>. It is better to use <a title="DateTime::add() on PHP Manual" href="http://www.php.net/manual/en/datetime.add.php" target="_blank">DateTime::add()</a> and <a title="DateTime::sub() on PHP Manual" href="http://www.php.net/manual/en/datetime.sub.php" target="_blank">DateTime::sub()</a> <strong>in PHP 5.3</strong> and later, or <a title="DateTime::modify() on PHP Manual" href="http://www.php.net/manual/en/datetime.modify.php" target="_blank">DateTime::modify()</a> <strong>in PHP 5.2</strong>.</p>
<p style="text-align: justify;">Returns a <strong>timestamp on success, FALSE otherwise. Previous to PHP 5.1.0</strong>, this function <strong>would return -1 on failure</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.joaomorais.com/date-conversions-with-strtotime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Asus Eee PC 1201N &#8211; Ram Upgrade</title>
		<link>http://blog.joaomorais.com/asus-eee-pc-1201n-ram-upgrade/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=asus-eee-pc-1201n-ram-upgrade</link>
		<comments>http://blog.joaomorais.com/asus-eee-pc-1201n-ram-upgrade/#comments</comments>
		<pubDate>Sun, 21 Mar 2010 19:40:12 +0000</pubDate>
		<dc:creator>João Morais</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Papers]]></category>
		<category><![CDATA[1201N]]></category>
		<category><![CDATA[1GB]]></category>
		<category><![CDATA[2GB]]></category>
		<category><![CDATA[4GB]]></category>
		<category><![CDATA[800mhz]]></category>
		<category><![CDATA[ASint]]></category>
		<category><![CDATA[Asus]]></category>
		<category><![CDATA[CL6]]></category>
		<category><![CDATA[DDR2]]></category>
		<category><![CDATA[DDRII]]></category>
		<category><![CDATA[Eee]]></category>
		<category><![CDATA[Kingston]]></category>
		<category><![CDATA[KVR800D2S6/2G]]></category>
		<category><![CDATA[Memory Ram]]></category>
		<category><![CDATA[NON-ECC]]></category>
		<category><![CDATA[PC2-6400]]></category>
		<category><![CDATA[SODIMM]]></category>
		<category><![CDATA[Upgrade]]></category>

		<guid isPermaLink="false">http://www.blog.joaomorais.com/?p=762</guid>
		<description><![CDATA[Since I bought this netbook that I&#8217;ve been looking forward to upgrade it&#8217;s ram. As you may know, this netbook has two slots, which by default are fulfilled with 2GB (1024+1024) or 3GB (1024+2048), unfortunately in Portugal only the first combination is being sold. After reading a couple of reviews of other people that wanted to perform [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/joaomorais/4450621640/"><img class="alignright" title="Asus Eee PC 1201N Silver" src="http://farm3.static.flickr.com/2720/4450621640_39fd7fe123_m.jpg" alt="" width="126" height="168" /></a>Since I bought this netbook that I&#8217;ve been looking forward to upgrade it&#8217;s ram. As you may know, this netbook has two slots, which by default are fulfilled with 2GB (1024+1024) or 3GB (1024+2048), unfortunately in Portugal only the first combination is being sold.</p>
<p>After reading a couple of reviews of other people that wanted to perform the same upgrade as me, from 2GB into 4GB, I’ve finally decided to bet on Kingston, and I bought the <a title="KVR800D2S6K2/2G description at Kingston's website" href="http://www.ec.kingston.com/ecom/configurator_new/partsinfo.asp?root=europe&amp;LinkBack=http://www.valueram.com/europe&amp;ktcpartno=KVR800D2S6K2/2G">KVR800D2S6K2/2G</a> modules.</p>
<p>Now you may be wondering why I didn’t bought 8GB instead of 4GB since the netbook supports them, the reason is plain simple: in my humble opinion they are way too expensive!</p>
<p><span id="more-762"></span></p>
<p>Here is a list of <a title="Kingston Memory Upgrades for Asus Eee PC 1201N" href="http://www.ec.kingston.com/ecom/configurator_new/modelsinfo.asp?id=1&amp;SysID=60029&amp;mfr=ASUS/ASmobile&amp;model=Eee+PC+1201N&amp;search_type=&amp;root=europe&amp;LinkBack=http://www.valueram.com/europe&amp;Sys=60029-ASUS/ASmobile-Eee+PC+1201N&amp;distributor=0&amp;submit1=Search">Kingston memory upgrades for Asus Eee PC 1201N</a>.</p>
<p>While performing the upgrade I decided to take a couple of photos to illustrate the process.</p>
<p style="text-align: center;"><a href="http://www.flickr.com/photos/joaomorais/4448557232/"><img class=" alignnone" title="System Monitor" src="http://farm5.static.flickr.com/4057/4448557232_68cbf11c26_m.jpg" alt="System Monitor" width="240" height="151" /></a> <a href="http://www.flickr.com/photos/joaomorais/4448557230/"><img title="System Monitor - Resources" src="http://farm5.static.flickr.com/4012/4448557230_ddba43df83_m.jpg" alt="" width="240" height="151" /></a></p>
<p style="text-align: center;">First I took a couple of screenshots of Gnome&#8217;s system monitor before the upgrade.</p>
<p style="text-align: center;"><a href="http://www.flickr.com/photos/joaomorais/4448557230/"></a><a href="http://www.flickr.com/photos/joaomorais/4448550008/"><img class="   aligncenter" title="Kingston Memory Ram" src="http://farm5.static.flickr.com/4052/4448550008_8272bedb89_m.jpg" alt="" width="240" height="160" /></a></p>
<p style="text-align: center;">The two brand new Kingston ram modules that I bought. As you can see in the picture their specifications are: <a title="KVR800D2S6K2/2G description at Kingston's website" href="http://www.ec.kingston.com/ecom/configurator_new/partsinfo.asp?root=europe&amp;LinkBack=http://www.valueram.com/europe&amp;ktcpartno=KVR800D2S6K2/2G">KVR800D2S6K2/2G</a> 2GB PC2-6400 CL6 NON-ECC 200-Pin SODIMM.</p>
<p style="text-align: center;"><a href="http://www.flickr.com/photos/joaomorais/4448550014/"><img class=" alignnone" title="Asus Eee PC 1201N Silver - Backside" src="http://farm5.static.flickr.com/4010/4448550014_040d094b96_m.jpg" alt="" width="240" height="160" /> </a><a href="http://www.flickr.com/photos/joaomorais/4448550024/"><img title="Asus Eee PC 1201N Silver - Memory Compartment" src="http://farm5.static.flickr.com/4066/4448550024_50168f7fb2_m.jpg" alt="" width="160" height="240" /></a></p>
<p style="text-align: center;">The backside of the netbook and a closer look at the memory compartment.</p>
<p style="text-align: center;"><a href="http://www.flickr.com/photos/joaomorais/4448550030/"><img class="alignnone" title="Asus Eee PC 1201N Silver - Memory Compartment" src="http://farm3.static.flickr.com/2737/4448550030_01ee34fab5_m.jpg" alt="" width="240" height="160" /> </a><a href="http://www.flickr.com/photos/joaomorais/4448550032/"><img title="Asus Eee PC 1201N Silver - Memory Compartment" src="http://farm3.static.flickr.com/2725/4448550032_9cdcb5060f_m.jpg" alt="" width="160" height="240" /></a></p>
<p style="text-align: center;">Another photo of it&#8217;s backside, after removing the screws from memory compartment, we can see the default memory ram modules: two dimms of 1GB each.</p>
<p><a href="http://www.flickr.com/photos/joaomorais/4448550032/"> </a></p>
<p style="text-align: center;"><a href="http://www.flickr.com/photos/joaomorais/4448550036/"><img class="alignnone" title="Comparing Memory Ram" src="http://farm3.static.flickr.com/2802/4448550036_736e3c087f_m.jpg" alt="" width="240" height="160" /> </a></p>
<p style="text-align: center;"><a href="http://www.flickr.com/photos/joaomorais/4448550036/"></a>In this photo we can see a comparison of both memory ram modules. At the top we have one of the modules that is installed by default in this netbook, an ASint DDRII 1GB-800, and the new one at the bottom.</p>
<p style="text-align: center;"><a href="http://www.flickr.com/photos/joaomorais/4450660398/"><img class="alignnone" src="http://farm5.static.flickr.com/4030/4450660398_19c52d308b_m.jpg" alt="" width="240" height="180" /></a> <a href="http://www.flickr.com/photos/joaomorais/4450660432/"><img class="alignnone" title="Asus Eee PC 1201N Silver - Memory Compartment" src="http://farm5.static.flickr.com/4044/4450660432_40eb19669d_m.jpg" alt="" width="180" height="240" /> </a></p>
<p style="text-align: center;"><a href="http://www.flickr.com/photos/joaomorais/4450660432/"></a>Another photo of it&#8217;s backside after installing the new memory modules.</p>
<p style="text-align: center;">
<p style="text-align: center;"><a href="http://www.flickr.com/photos/joaomorais/4448557238/"><img class="alignnone" title="System Monitor" src="http://farm5.static.flickr.com/4005/4448557238_994e1a72da_m.jpg" alt="" width="240" height="151" /> </a><a href="http://www.flickr.com/photos/joaomorais/4448557234/"><img title="System Monitor Resources" src="http://farm3.static.flickr.com/2793/4448557234_a6b125e1d8_m.jpg" alt="" width="240" height="151" /></a></p>
<p style="text-align: center;">To finish the sequence, here is Gnome&#8217;s system monitor screenshots after the upgrade.</p>
<p style="text-align: left;">Because I&#8217;m currently using a 64bits version of <a title="Ubuntu Home Page" href="http://www.ubuntu.com/">Ubuntu</a> I didn&#8217;t found any kind of problem related with the recognition of the new modules, but from what I&#8217;ve read, in 32bits versions there may be problems which require a couple of updates.</p>
<p style="text-align: left;">As you can see performing the upgrade is a really simple process that takes only a couple of minutes. If after this, you are still with afraid of screwing your netbook <a title="How to Upgrade your Laptop Memory" href="http://www.youtube.com/watch?v=yirNejnzbEM">here</a> is a video that shows you, once again, how simple it is to upgrade your netbook memory.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.joaomorais.com/asus-eee-pc-1201n-ram-upgrade/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to setup Asus Eee PC 1201N Wireless Card on Ubuntu 9.10?</title>
		<link>http://blog.joaomorais.com/how-to-setup-asus-eee-pc-1201n-wireless-card-on-ubuntu-9-10/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-setup-asus-eee-pc-1201n-wireless-card-on-ubuntu-9-10</link>
		<comments>http://blog.joaomorais.com/how-to-setup-asus-eee-pc-1201n-wireless-card-on-ubuntu-9-10/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 23:49:51 +0000</pubDate>
		<dc:creator>João Morais</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Papers]]></category>
		<category><![CDATA[1201N]]></category>
		<category><![CDATA[8171]]></category>
		<category><![CDATA[Asus]]></category>
		<category><![CDATA[Eee]]></category>
		<category><![CDATA[Realtek]]></category>
		<category><![CDATA[rtl8191se]]></category>
		<category><![CDATA[rtl8192se]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Wireless]]></category>

		<guid isPermaLink="false">http://www.blog.joaomorais.com/?p=731</guid>
		<description><![CDATA[The first thing you need to know it&#8217;s that although the PCI output shows a Realtek 8171 wireless adapter, in reality it is a Realtek RTL8191SE! With this in mind you only need to download this file which was referenced in this thread on post #134 and execute the commands below. Make sure to remove the NDISWrapper driver before [...]]]></description>
				<content:encoded><![CDATA[<h1><img class="alignright  wp-image-737" title="Wireless" src="http://blog.joaomorais.com/wp-content/uploads/wireless.jpg" alt="" width="192" height="191" />The first thing you need to know it&#8217;s that although the PCI output shows a Realtek 8171 wireless adapter, in reality it is a Realtek RTL8191SE!</h1>
<p>With this in mind you only need to download this <a title="rtl8192se driver" href="http://launchpadlibrarian.net/366886...11.2009.tar.gz">file</a> which was referenced in this <a title="Realtek RTL8192SE WLAN Card Fails to work on Medion Akoya E1312 Netbook" href="https://bugs.launchpad.net/ubuntu/+s...6?comments=all">thread</a> on <a title="Realtek RTL8192SE WLAN Card Fails to work on Medion Akoya E1312 Netbook - Post #134" href="https://bugs.launchpad.net/ubuntu/+source/linux/+bug/401126/comments/134">post #134</a> and execute the commands below. Make sure to remove the NDISWrapper driver before doing this if you have already installed and set it up.</p>
<p><span id="more-731"></span>After download, unpack driver:</p>
<pre class="brush:shell">$ tar xvf rtl8192se_linux_2.6.0010.1211.2009.tar.gz
$ cd rtl8192se_linux_2.6.0010.1211.2009
$ sudo make</pre>
<p>Then you need to edit two files:</p>
<pre class="brush:shell">$ sed -i 's/install: modules/install:/g' ./ieee80211/Makefile
$ sed -i 's/install: modules/install:/g' ./HAL/rtl8192/Makefile</pre>
<p>Finally install and load:</p>
<pre class="brush:shell">$ sudo make install
$ sudo echo "r8192se_pci" &gt;&gt; /etc/modules
$ sudo modprobe r8192se_pci</pre>
<p>Your wireless should now be working.</p>
<p>Credits go out to <a title="CompMas2 profile at ubuntuforums.org" href="http://ubuntuforums.org/member.php?u=1009073">CompMas2</a> of ubuntuforums.org for the <a title="rtl8192se - Wireless Problems on 1201N" href="http://ubuntuforums.org/showthread.php?t=1394281">quick answer</a> and to <a title="david woo profile at lauchpad.net" href="https://launchpad.net/~wooshwu">david woo</a> of lauchpad.net for making this driver available.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.joaomorais.com/how-to-setup-asus-eee-pc-1201n-wireless-card-on-ubuntu-9-10/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>How to use NTLM authentication with NuSOAP?</title>
		<link>http://blog.joaomorais.com/how-to-use-ntlm-authentication-with-nusoap/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-use-ntlm-authentication-with-nusoap</link>
		<comments>http://blog.joaomorais.com/how-to-use-ntlm-authentication-with-nusoap/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 23:46:22 +0000</pubDate>
		<dc:creator>João Morais</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Papers]]></category>
		<category><![CDATA[Authentication]]></category>
		<category><![CDATA[cURL]]></category>
		<category><![CDATA[NTLM]]></category>
		<category><![CDATA[NuSOAP]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[SOAP]]></category>
		<category><![CDATA[SugarCRM]]></category>
		<category><![CDATA[Webservices]]></category>

		<guid isPermaLink="false">http://blog.joaomorais.com/?p=573</guid>
		<description><![CDATA[For a couple of weeks I&#8217;ve been implementing Webservices to feed resources on a SugarCRM project that I&#8217;m working on. As you may know SugarCRM provides NuSOAP, which is a SOAP Toolkit for PHP that brings some extra functionalities to SOAP implementation provided by PHP. Today I had to use NTLM authentication method, unfortunately it [...]]]></description>
				<content:encoded><![CDATA[<p>For a couple of weeks I&#8217;ve been implementing <a title="Webservices on Wikipedia" href="http://en.wikipedia.org/wiki/Webservices">Webservices</a> to feed resources on a <a title="SugarCRM - Commercial Open Source CRM" href="http://www.sugarcrm.com">SugarCRM</a> project that I&#8217;m working on. As you may know <a title="SugarCRM - Commercial Open Source CRM" href="http://www.sugarcrm.com/">SugarCRM</a> provides <a title="NuSOAP - SOAP Toolkit for PHP" href="http://sourceforge.net/projects/nusoap/">NuSOAP</a>, which is a <a title="SOAP on Wikipedia" href="http://en.wikipedia.org/wiki/SOAP">SOAP</a> Toolkit for PHP that brings some extra functionalities to <a title="PHP Soap Implementation" href="http://www.php.net/soap">SOAP implementation</a> provided by PHP.</p>
<p>Today I had to use NTLM authentication method, unfortunately it isn&#8217;t supported by <a title="NuSOAP - SOAP Toolkit for PHP" href="http://sourceforge.net/projects/nusoap/">NuSOAP</a> yet, but I&#8217;ve found that if you combine <a title="Client URL Request Library" href="http://www.php.net/curl">cURL</a> with <a title="NuSOAP - SOAP Toolkit for PHP" href="http://sourceforge.net/projects/nusoap/">NuSOAP</a> you can get through without a problem.</p>
<p><span id="more-573"></span>So here is the solution I came up with:</p>
<p>First of all I&#8217;ve upgraded <a title="NuSOAP - SOAP Toolkit for PHP" href="http://sourceforge.net/projects/nusoap/">NuSOAP</a> to it&#8217;s latest version which is 0.7.3 (the one provided by <a title="SugarCRM - Commercial Open Source CRM" href="http://www.sugarcrm.com/">SugarCRM</a> didn&#8217;t supported <a title="Client URL Request Library" href="http://www.php.net/curl">cURL</a> yet), then I wrote something similar to the code below.</p>
<pre class="brush:php">&lt;?php

$wsdl = 'http://project/file.php?wsdl';

$client = new nusoap_client($wsdl, true);
$client-&gt;setCredentials('', '', 'ntlm');
$client-&gt;setUseCurl(true);
$client-&gt;useHTTPPersistentConnection();
$client-&gt;setCurlOption(CURLOPT_USERPWD, 'auth_username:auth_password');

?&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.joaomorais.com/how-to-use-ntlm-authentication-with-nusoap/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Google Chrome Web Browser Installation on Linux</title>
		<link>http://blog.joaomorais.com/google-chrome-web-browser-installation-on-linux/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=google-chrome-web-browser-installation-on-linux</link>
		<comments>http://blog.joaomorais.com/google-chrome-web-browser-installation-on-linux/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 22:14:47 +0000</pubDate>
		<dc:creator>João Morais</dc:creator>
				<category><![CDATA[Papers]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Browser]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Chromium]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://blog.joaomorais.com/?p=399</guid>
		<description><![CDATA[Tired of the slowness of Mozilla Firefox and curious with the acclaimed performance of Google Chrome (or Chromium, if you prefer), today I&#8217;ve decided to give it a try. Although it is still an alpha version it already allows you to perform the regular navigation activities that you are used to with an incredible speed. [...]]]></description>
				<content:encoded><![CDATA[<p><img class="alignright  wp-image-401" title="Google Chrome (Chromium)" src="http://blog.joaomorais.com/wp-content/uploads/google-chrome_256-150x150.png" alt="Google Chromium" />Tired of the slowness of <a title="Mozilla Firefox" href="http://www.mozilla.com/firefox/">Mozilla Firefox</a> and curious with the acclaimed performance of <a title="Google Chrome (Chromium)" href="http://code.google.com/chromium/">Google Chrome</a> (or <a title="Google Chrome (Chromium)" href="http://code.google.com/chromium/">Chromium</a>, if you prefer), today I&#8217;ve decided to give it a try.</p>
<p>Although it is still an alpha version it already allows you to perform the regular navigation activities that you are used to with an incredible speed.</p>
<p>It&#8217;s layout is also a bit different of what we are used to, in my opinion it is great, <a title="KISS principle in Wikipedia" href="http://en.wikipedia.org/wiki/KISS_principle">KISS principle</a> all the way.  I also like the new functionalities like the task manager which allows you to take control over the used memory with each tab/window and the browser itself.</p>
<p><span id="more-399"></span>With all this in mind I expect a great browser to arise from <a title="Google" href="http://www.google.com">Google</a> in the next months. Below are the steps that I needed to perform to install <a title="Google Chrome (Chromium)" href="http://code.google.com/chromium/">Chromium</a> on <a title="Xubuntu" href="http://www.xubuntu.org/">Xubuntu</a> 8.10 (Intrepid).</p>
<p>First of all you need to edit the /etc/apt/sources.list file:</p>
<pre class="brush:shell">$ sudo gedit /etc/apt/sources.list</pre>
<p>Add the following two lines at the bottom of the file:</p>
<pre class="brush:shell">deb http://ppa.launchpad.net/chromium-daily/ppa/ubuntu intrepid main
deb-src http://ppa.launchpad.net/chromium-daily/ppa/ubuntu intrepid main</pre>
<p>Now save/close the file and add the GPG key using the following command:</p>
<pre class="brush:shell">--rev-keys --keyserver keyserver.ubuntu.com 0xfbef0d696de1c72ba5a835fe5a9bf3bb4e5e17b5</pre>
<p>Next we will update the source list and install the browser:</p>
<pre class="brush:shell">$ sudo apt-get update
$ sudo apt-get install chromium-browser</pre>
<p>If you want you can also enable flash support by copying (or linking) your previously installed flash library into browser plugins directory:</p>
<pre class="brush:shell">$ sudo cp /usr/lib/flashplugin-installer/libflashplayer.so /usr/lib/chromium-browser/plugins</pre>
<p>And you are done, next time you run it you will only need to specify the plugins usage with following command:</p>
<pre class="brush:shell">$ chromium-browser --enable-plugins</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.joaomorais.com/google-chrome-web-browser-installation-on-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Column Truncation Vulnerabilities</title>
		<link>http://blog.joaomorais.com/sql-column-truncation-vulnerabilities/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sql-column-truncation-vulnerabilities</link>
		<comments>http://blog.joaomorais.com/sql-column-truncation-vulnerabilities/#comments</comments>
		<pubDate>Sat, 20 Sep 2008 11:24:49 +0000</pubDate>
		<dc:creator>João Morais</dc:creator>
				<category><![CDATA[Papers]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Truncation]]></category>
		<category><![CDATA[Vulnerabilities]]></category>

		<guid isPermaLink="false">http://solidlocker.webhs.org/wordpress/?p=63</guid>
		<description><![CDATA[One of the biggest concerns for Web Developers while developing something with SQL, is to avoid SQL-Injection problems, because those are the most common security flaws. But there are also another flaws that you should be aware about, for example, column truncation vulnerabilities. This security flaw it&#8217;s related with the lack of input length validations [...]]]></description>
				<content:encoded><![CDATA[<p>One of the biggest concerns for Web Developers while developing something with SQL, is to avoid <a title="SQL-Injection" href="http://en.wikipedia.org/wiki/SQL_injection">SQL-Injection</a> problems, because those are the most common security flaws.</p>
<p>But there are also another flaws that you should be aware about, for example, column truncation vulnerabilities.</p>
<p>This security flaw it&#8217;s related with the lack of input length validations and it seems that it is affecting a lot of known applications.</p>
<p>Stefan Esser wrote a great <a title="MySQL and SQL Column Truncation Vulnerabilities" href="http://www.suspekt.org/2008/08/18/mysql-and-sql-column-truncation-vulnerabilities/">tutorial</a> about this subject it&#8217;s a must read.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.joaomorais.com/sql-column-truncation-vulnerabilities/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to translate administrator menu items in Joomla! 1.5.6?</title>
		<link>http://blog.joaomorais.com/how-to-translate-administrator-menu-items-in-joomla-1-5-6/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-translate-administrator-menu-items-in-joomla-1-5-6</link>
		<comments>http://blog.joaomorais.com/how-to-translate-administrator-menu-items-in-joomla-1-5-6/#comments</comments>
		<pubDate>Thu, 14 Aug 2008 12:49:03 +0000</pubDate>
		<dc:creator>João Morais</dc:creator>
				<category><![CDATA[Papers]]></category>
		<category><![CDATA[1.5.6]]></category>
		<category><![CDATA[Administrator]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[Items]]></category>
		<category><![CDATA[Joomla!]]></category>
		<category><![CDATA[Menu]]></category>

		<guid isPermaLink="false">http://solidlocker.webhs.org/wordpress/?p=157</guid>
		<description><![CDATA[That’s a question that I’ve been doing to myself in the past two days. Unfortunately there aren’t much informations about this subject, and from what I’ve read there is a lot of people with the same doubts I had. Because I haven’t found any documentation on this subject I’ve decided to write the my own [...]]]></description>
				<content:encoded><![CDATA[<p>That’s a question that I’ve been doing to myself in the past two days.</p>
<p>Unfortunately there aren’t much informations about this subject, and from what I’ve read there is a lot of people with the same doubts I had.</p>
<p>Because I haven’t found any documentation on this subject I’ve decided to write the my own tutorial, hope it helps you.</p>
<p><span id="more-157"></span></p>
<p>Assuming that you already know how to create a <a title="Joomla!" href="http://joomla.org/">Joomla!</a> component setup XML file, I’ll write here how you can translate your administrator menu items using language packages. That way I will not talk about website front-end since I’m only focusing on administration menus.</p>
<p>I will also assume that you have a directory structure similar to the one below:</p>
<pre class="brush:plain">com_mycomponent
com_mycomponent/mycomponent.xml
com_mycomponent/admin
com_mycomponent/admin/index.html
com_mycomponent/admin/language
com_mycomponent/admin/language/index.html
com_mycomponent/admin/language/en-GB.com_mycomponent.ini
com_mycomponent/admin/language/en-GB.com_mycomponent.menu.ini
com_mycomponent/admin/language/pt-PT.com_mycomponent.ini
com_mycomponent/admin/language/pt-PT.com_mycomponent.menu.ini</pre>
<p>1. Open XML setup file.</p>
<pre class="brush:shell">$ geany com_mycomponent/mycompoment.xml</pre>
<p>2. Open administration tag and start to write component administration menu, our component’s menu will be composed by a title (COM_MYCOMPONENT) and two child links (LINK-1 and LINK-2). Note that all &amp; must be escaped to &amp;amp; for the file to be valid XML and be parsed by the installer.</p>
<pre class="brush:plain">&lt;administration&gt;
&lt;menu&gt;COM_MYCOMPONENT&lt;/menu&gt;
&lt;submenu&gt;
&lt;menu link=”option=com_mycomponent&amp;amp;controller=c1“&gt;LINK-1&lt;/menu&gt;
&lt;menu link=”option=com_mycomponent&amp;amp;controller=c2“&gt;LINK-2&lt;/menu&gt;
&lt;/submenu&gt;</pre>
<p>Now that we&#8217;ve finished the component administration menu, we will load language package files that will translate your component administration menu itens.<br />
For this example we will have two different translations, English and Portuguese.<br />
Although we are writing four files, two pairs for each language, the *.menu.ini are the ones that matter for this tutorial, the other ones are used to translate other texts that you will use in your component.</p>
<pre class="brush:plain">&lt;languages folder=”admin/language”&gt;
&lt;language tag=”en-GB”&gt;en-GB.com_mycomponent.ini&lt;/language&gt;
&lt;language tag=”en-GB”&gt;en-GB.com_mycomponent.menu.ini&lt;/language&gt;
&lt;language tag=”pt-PT”&gt;pt-PT.com_mycomponent.ini&lt;/language&gt;
&lt;language tag=”pt-PT”&gt;pt-PT.com_mycomponent.menu.ini&lt;/language&gt;
&lt;/languages&gt;
&lt;/administration&gt;</pre>
<p>End of component administration supported languages and close administration tag.</p>
<p>3. Edit the English package file and write the translations for the items you’ve just created.</p>
<pre class="brush:shell">$ geany com_mycomponent/admin/language/en-GB.com_mycomponent.menu.ini</pre>
<pre class="brush:plain">COM_MYCOMPONENT=My Component
COM_MYCOMPONENT.LINK-1=Link number one
COM_MYCOMPONENT.LINK-2=Link number two</pre>
<p>4. Repeat the step #3 for the Portuguese package file.</p>
<pre class="brush:shell">$ geany com_mycomponent/admin/language/pt-PT.com_mycomponent.menu.ini</pre>
<pre class="brush:plain">COM_MYCOMPONENT=O meu Componente
COM_MYCOMPONENT.LINK-1=Ligação número 1
COM_MYCOMPONENT.LINK-2=Ligação número 2</pre>
<p>Note : All ini files need to be saved as UTF-8.</p>
<p>With this four steps you are able to translate your component administrator menu items, although it is a simple process, unfortunately there isn’t much documentation on this subject, and the one that exists is a bit poor and doesn’t explain all the steps.</p>
<p>To complete what I’ve wrote in here you can also take a look at <a title="Translating  entries on the Components menu" href="http://docs.joomla.org/Tutorial:Translating_entries_on_the_Components_menu">this</a> tutorial that talks about this subject, and you may also take a look at <a title="Tutorials about Components" href="http://www.joomladevuser.com/tutorials/components">this one</a> that covers the steps needed to follow while developing a component.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.joaomorais.com/how-to-translate-administrator-menu-items-in-joomla-1-5-6/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>MySQL bug related with natural number order fix</title>
		<link>http://blog.joaomorais.com/mysql-bug-related-with-natural-number-order-fix/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mysql-bug-related-with-natural-number-order-fix</link>
		<comments>http://blog.joaomorais.com/mysql-bug-related-with-natural-number-order-fix/#comments</comments>
		<pubDate>Fri, 18 Jul 2008 11:11:21 +0000</pubDate>
		<dc:creator>João Morais</dc:creator>
				<category><![CDATA[Papers]]></category>
		<category><![CDATA[Bug]]></category>
		<category><![CDATA[Fix]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Number]]></category>
		<category><![CDATA[Order]]></category>

		<guid isPermaLink="false">http://solidlocker.webhs.org/wordpress/?p=161</guid>
		<description><![CDATA[It seems that this is a known bug but I only noticed it yesterday. Imagine you have a field named price and it&#8217;s type is VARCHAR (it doesn&#8217;t matter why it&#8217;s not INT or FLOAT) and you want to use ORDER BY clause so you can list table rows ordered by price value. It won&#8217;t [...]]]></description>
				<content:encoded><![CDATA[<p>It seems that this is a known bug but I only noticed it yesterday.</p>
<p>Imagine you have a field named price and it&#8217;s type is VARCHAR (it doesn&#8217;t matter why it&#8217;s not INT or FLOAT) and you want to use ORDER BY clause so you can list table rows ordered by price value.</p>
<p>It won&#8217;t work, since the prices will be listed alphabetically, you may read here how to fix this issue.</p>
<p><span id="more-161"></span>If you have a table labeled products, a field labeled price (typed as VARCHAR) and the following values: 1, 2, 3, 7, 8, 53, 47, 32, 99 and 327.</p>
<p>And you perform a query similar to the one below:</p>
<pre class="brush:sql">SELECT price FROM products ORDER BY price;</pre>
<p>The result will be:</p>
<pre class="brush:plain">1, 2, 3, 32, 327,47, 53, 7, 8, 99</pre>
<p>As you can see the product prices are ordered alphabetically to fix this you should add + 0 to the query (see example below):</p>
<pre class="brush:sql">SELECT price FROM products ORDER BY price + 0;</pre>
<p>The result will be:</p>
<pre class="brush:plain">1, 2, 3, 7, 8, 32, 47, 53, 99, 327</pre>
<p>Problem solved, now your rows will be sorted by price correctly.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.joaomorais.com/mysql-bug-related-with-natural-number-order-fix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
