<?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>Tiplite</title>
	<atom:link href="http://www.tiplite.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tiplite.com</link>
	<description>Keep It Simple Smart</description>
	<lastBuildDate>Thu, 10 Jan 2013 21:23:20 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
		<item>
		<title>CakePHP 1.3 helper auto-complete in netbeans</title>
		<link>http://www.tiplite.com/cakephp-1-3-helper-auto-complete-in-netbeans/</link>
		<comments>http://www.tiplite.com/cakephp-1-3-helper-auto-complete-in-netbeans/#comments</comments>
		<pubDate>Mon, 30 Jan 2012 21:06:08 +0000</pubDate>
		<dc:creator>tiplite</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[auto complete]]></category>
		<category><![CDATA[helpers]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.tiplite.com/?p=178</guid>
		<description><![CDATA[CakePHP 1.3 introduced a new way to use helpers. This was added to prevent confusion between helper variables and local variables added to the view file. You can access helper methods in a view by using $this-&#62;Helper-&#62;method(). This way make &#8230; <a href="http://www.tiplite.com/cakephp-1-3-helper-auto-complete-in-netbeans/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="ads" style="text-align: center; margin: 20px auto; width: 468px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-7208047014320497";
/* Tiplite-banner */
google_ad_slot = "5199664288";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><p>CakePHP 1.3 introduced a new way to use helpers. This was added to prevent confusion between helper variables and local variables added to the view file. You can access helper methods in a view by using <code>$this-&gt;Helper-&gt;method()</code>. This way make a problem if you want to use auto-complete for helpers introduced in a <a href="http://www.tiplite.com/cakephp-support-in-netbeans/">previous article</a><br />
<span id="more-178"></span><br />
With a small trick you can make netbeans supports this method auto-complete. To do this add a file in your project folder, or preferable to be in CakePHP core folder, with a name <code>dummy_view.php</code> for example. Now add the following code to this file.</p>
<pre class="brush:php">&lt;?php

class DummyView extends View {

    /**
     * @var HtmlHelper
     */
    public $Html;

    /**
     * @var JsHelper
     */
    public $Js;

    /**
     * @var AjaxHelper
     */
    public $Ajax;

    /**
     * @var JavascriptHelper
     */
    public $Javascript;

    /**
     * @var FormHelper
     */
    public $Form;

    /**
     * @var SessionHelper
     */
    public $Session;

    /**
     * @var TextHelper
     */
    public $Text;

    /**
     * @var PaginationHelper
     */
    public $Paginator;

    /**
     * @var RssHelper
     */
    public $Rss;

    /**
     * @var XmlHelper
     */
    public $Xml;

    /**
     * @var CacheHelper
     */
    public $Cache;

    /**
     * @var TimeHelper
     */
    public $Time;

}</pre>
<p>Now put the following line of code in end of your view file:</p>
<pre class="brush:php">&lt;?php /* @var $this DummyView */ ?&gt;</pre>
<p>Now you&#8217;ll see that netbeans displays auto-complete for those helper methods and view methods too like <code class="brush:php">$this-&gt;element()</code> for example.</p>
<div id="attachment_184" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.tiplite.com/wp-content/uploads/2012/01/netbeans-cake-1.3.jpg"><img class="size-medium wp-image-184" title="netbeans-cake-1.3" src="http://www.tiplite.com/wp-content/uploads/2012/01/netbeans-cake-1.3-300x172.jpg" alt="CakePHP 1.3 helper auto complete in netbeans" width="300" height="172" /></a><p class="wp-caption-text">Autocomplete for CakePHP 1.3 helpers in netbeans</p></div>
<h2>How does this work?</h2>
<p>The idea here is simple we tell netbeans that there is a new class that extends <code class="brush:php">View</code> class. Then when in view file we tell netbeans to consider that <code class="brush:php">$this</code> has the type <code class="brush:php">DummyView</code>. CakePHP run the code in view files inside <code class="brush:php">render()</code> method in <code class="brush:php">View</code> class so <code class="brush:php">$this</code> is really an instance of <code class="brush:php">View</code> class. Now as netbeans knows the type of <code>$this</code> variable and knows the types of its variables, which are CakePHP helpers, it shows their autocomplete options.</p>
<p>Finally, you should be aware of the following:</p>
<ul>
<li>Make sure to include your CakePHP core path in netbeans include path or it is inside your project source folder.</li>
<li>This will not load helpers in run time, so make sure you include required helpers in your controller.</li>
<li>You can add your own custom helper in <code>DummyView</code> class using the same method as core helpers.</li>
</ul>
<p>I know this has been late but it is still useful <img src='http://www.tiplite.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div style="width: 480px; margin: 10px auto">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-7208047014320497";
/* Tiplite-banner */
google_ad_slot = "5199664288";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.tiplite.com/cakephp-1-3-helper-auto-complete-in-netbeans/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick tip: Get element content within the controller in CakePHP</title>
		<link>http://www.tiplite.com/element-content-within-controller/</link>
		<comments>http://www.tiplite.com/element-content-within-controller/#comments</comments>
		<pubDate>Tue, 01 Nov 2011 20:59:16 +0000</pubDate>
		<dc:creator>tiplite</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[controller]]></category>
		<category><![CDATA[element]]></category>
		<category><![CDATA[quicktip]]></category>

		<guid isPermaLink="false">http://www.tiplite.com/?p=160</guid>
		<description><![CDATA[This is an easy quick tip to able able to get an element&#8217;s content from within a controller in CakePHP 1.2 or 1.3. The trick is simple you just need an instance from View class to be able to use &#8230; <a href="http://www.tiplite.com/element-content-within-controller/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="ads" style="text-align: center; margin: 20px auto; width: 468px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-7208047014320497";
/* Tiplite-banner */
google_ad_slot = "5199664288";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><p>This is an easy quick tip to able able to get an element&#8217;s content from within a controller in CakePHP 1.2 or 1.3. The trick is simple you just need an instance from <code class="brush:php">View</code> class to be able to use its <code class="brush:php">element</code> function within the controller.<span id="more-160"></span> To do this use the following code inside your action:</p>
<pre class="brush:php">$view = new View($this, false);
$content = $view-&gt;element('my-element', $params);</pre>
</p>
<p><code>$params</code> is an optional parameters array which is sent to the element to be used as variables. You can also use <code class="brush:php">$view-&gt;set()</code> just as you use <code class="brush:php">$this-&gt;set()</code> in your controller.</p>
<p>Now as you know it, how you intend to use? or what was the situation where you needed to use something like this?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tiplite.com/element-content-within-controller/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to install RVM on Windows using cygwin</title>
		<link>http://www.tiplite.com/how-to-install-rvm-on-windows-using-cygwin/</link>
		<comments>http://www.tiplite.com/how-to-install-rvm-on-windows-using-cygwin/#comments</comments>
		<pubDate>Sat, 21 May 2011 13:05:17 +0000</pubDate>
		<dc:creator>tiplite</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[System Administration]]></category>

		<guid isPermaLink="false">http://www.tiplite.com/?p=142</guid>
		<description><![CDATA[Ruby enVironment Management (RVM) is a tool to install multiple versions of Ruby which may be necessary when you want to develop or test applications that run on different versions of Ruby. RVM can be installed on Unix like operating &#8230; <a href="http://www.tiplite.com/how-to-install-rvm-on-windows-using-cygwin/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="ads" style="text-align: center; margin: 20px auto; width: 468px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-7208047014320497";
/* Tiplite-banner */
google_ad_slot = "5199664288";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><p>Ruby enVironment Management (RVM) is a tool to install multiple versions of Ruby which may be necessary when you want to develop or test applications that run on different versions of Ruby. RVM can be installed on Unix like operating systems like Linux or Mac OS. RVM doesn&#8217;t support Windows operating system yet.  But you can overcome this by using cygwin which brings Unix shell tools to Windows.</p>
<p><span id="more-142"></span><br />
You can download and install cygwin from its official site http://cygwin.com/. You will need to select the following packages to ensure proper installation of RVM and different versions of Ruby:</p>
<blockquote>
<ul>
<li><code>curl</code> for downloading RVM installer script</li>
<li><code>git</code> for downloading RVM files</li>
<li><code>mingw64-i686-gcc-g++</code> for compiling Ruby sources</li>
<li><code>make</code> for compiling Ruby sources</li>
<li><code>automake</code> for compiling Ruby sources</li>
<li><code>readline</code> for readline support in irb</li>
<li><code>readline-sources</code> for readline support in irb</li>
<li><code>libreadline7</code> for readline support in irb</li>
<li><code>libreadline7-sources</code> for readline support in irb</li>
<li><code>zlib-devel</code> required for installing gems (choose the one under Devel category)</li>
</ul>
</blockquote>
<p>For my personal preferences I usually install the following packages:</p>
<blockquote>
<ul>
<li><code>vim</code></li>
<li><code>mintty</code> a shell very similar to those on Unix systems
</ul>
</blockquote>
<p>After installation is complete, open cygwin shell and follow installation tips found on <a href="https://rvm.beginrescueend.com/rvm/install/" target="_blank">RVM official site</a> or read the great article <a href="http://net.tutsplus.com/tutorials/why-you-should-use-rvm/" target="_blank">Why you should use RVM?</a></p>
<p>If <code>curl</code> failed to download the script and run it, you can know that this is because SSL certificates are not installed. You can overcome this by using -k option, so the command to install is changed to:</p>
<pre class="brush:bash">
bash &lt; &lt;(curl -ks https://rvm.beginrescueend.com/install/rvm)
</pre>
<p>It worth telling that there are another project called <a href="https://github.com/vertiginous/pik"  target="_blank">pik</a> which does the same job as RVM, but what I disliked about it is that you need Ruby to run it and it is installed as a gem!!</p>
<div style="text-align: center">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-7208047014320497";
/* New Banner */
google_ad_slot = "1323901737";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.tiplite.com/how-to-install-rvm-on-windows-using-cygwin/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Convert all your MySQL database text fields to unicode (or any other encoding)</title>
		<link>http://www.tiplite.com/convert-all-your-mysql-database-text-fields-to-unicode-or-any-other-encoding/</link>
		<comments>http://www.tiplite.com/convert-all-your-mysql-database-text-fields-to-unicode-or-any-other-encoding/#comments</comments>
		<pubDate>Tue, 10 May 2011 19:49:51 +0000</pubDate>
		<dc:creator>tiplite</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[unicode]]></category>
		<category><![CDATA[utf8]]></category>
		<category><![CDATA[varchar]]></category>

		<guid isPermaLink="false">http://www.tiplite.com/?p=114</guid>
		<description><![CDATA[Have you ever faced a problem when the text fields in your database have different encoding? This usually happens when you import table structure from another database with a different encoding, or when you neglect the encoding at all, which &#8230; <a href="http://www.tiplite.com/convert-all-your-mysql-database-text-fields-to-unicode-or-any-other-encoding/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="ads" style="text-align: center; margin: 20px auto; width: 468px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-7208047014320497";
/* Tiplite-banner */
google_ad_slot = "5199664288";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><p>Have you ever faced a problem when the text fields in your database have different encoding? This usually happens when you import table structure from another database with a different encoding, or when you neglect the encoding at all, which I consider as a bad practice.<br />
Later, this can cause some queries to fail specially if you are comparing two text fields. This may seem as a rare case but I ran into it enough times to write this post <img src='http://www.tiplite.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> .<br />
<span id="more-114"></span><br />
This code can either run from command line if you have access to your hosting command line and this is the preferred method to me due to increased performance. You also can use it from your web browser if you have a shared hosting or prefer a cleaner GUI to show results. If don&#8217;t have a hosting service yet you can head first to <a href="http://www.webhostingsearch.com/reviews.php">web hosting reviews</a> for a professional comparison between hosting services.</p>
<p>You can download the file <a>here</a> or copy the following code directly.</p>
<pre class="brush:php">&lt;?php
$host = 'localhost';
$user = 'your_user_name';
$password = 'your_password';
$dbanme = 'your_database_here';

$link1 = mysql_connect($host, $user, $password);
mysql_select_db('information_schema', $link1);

$result = mysql_query("SELECT *  FROM `information_schema`.`COLUMNS` WHERE `TABLE_SCHEMA` = '$dbname' AND `DATA_TYPE` in ('varchar', 'text')", $link1) or die(mysql_error($link1));

$link2 = mysql_connect($host, $user, $password);
mysql_select_db($dbname, $link2);
$success = $fail = array();
$tables = array();
while (($row = mysql_fetch_assoc($result)) != false){
  $tables[$row['TABLE_NAME']] = $row['TABLE_NAME'];
  $query = "ALTER TABLE `{$row['TABLE_NAME']}` MODIFY `{$row['COLUMN_NAME']}` {$row['COLUMN_TYPE']} CHARACTER SET utf8 COLLATE utf8_unicode_ci ";

   if ($row['IS_NULLABLE'] == 'YES'){
     $query .= 'NULL';
   } else {
     $query .= 'NOT NULL';
   }

  $res = mysql_query($query, $link2);
  if ($res){
    $success["{$row['TABLE_NAME']}.{$row['COLUMN_NAME']}"] = $query;
  } else {
    $fail["{$row['TABLE_NAME']}.{$row['COLUMN_NAME']}"] = mysql_error($link2);
  }
}

echo '&lt;pre&gt;', print_r(compact('success', 'fail'), true), '&lt;/pre&gt;';

foreach ($tables as $table){
  mysql_query("ALTER TABLE `$table` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci", $link2);
}

mysql_query("ALTER DATABASE `$dbname` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci");</pre>
<p>For this code to work on your database don&#8217;t forget to change your database connection parameters.</p>
<p>You are welcome to contribute to the code at <a href="http://code.google.com/p/char2unicode/">http://code.google.com/p/char2unicode/</a>.</p>
<p>You also can test your skills in PHP by converting this code to use PDO or MySQLi or even introduce a code for other database providers.</p>
<p>Quick tip: If you want to select a <a href="http://www.webhostingsearch.com/php-web-hosting.php">php hosting</a> with suitable prices and services you can find it at web hosting reviews.</p>
<div style="text-align: center; margin-bottom: 10px">
<script type="text/javascript"><!--
google_ad_client = "pub-7208047014320497";
/* Tiplite-banner */
google_ad_slot = "5199664288";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.tiplite.com/convert-all-your-mysql-database-text-fields-to-unicode-or-any-other-encoding/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>CakePHP debug in NetBeans</title>
		<link>http://www.tiplite.com/cakephp-debug-in-netbeans/</link>
		<comments>http://www.tiplite.com/cakephp-debug-in-netbeans/#comments</comments>
		<pubDate>Sun, 29 Aug 2010 23:21:32 +0000</pubDate>
		<dc:creator>tiplite</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[php debug]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[xdebug]]></category>

		<guid isPermaLink="false">http://www.tiplite.com/?p=100</guid>
		<description><![CDATA[Debugging code can be the most vital task a developer required to do. Debugging makes it easy to find logical errors in code. NetBeans supports PHP debug using xdebug, but in CakePHP it is hard to make this work straight. &#8230; <a href="http://www.tiplite.com/cakephp-debug-in-netbeans/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="ads" style="text-align: center; margin: 20px auto; width: 468px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-7208047014320497";
/* Tiplite-banner */
google_ad_slot = "5199664288";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><p>Debugging code can be the most vital task a developer required to do. Debugging makes it easy to find logical errors in code. NetBeans supports PHP debug using <a href="http://www.google.com/cse?q=xdebug+php&amp;cx=partner-pub-7208047014320497:k0f870-s2zq" target="_blank">xdebug</a>, but in CakePHP it is hard to make this work straight. This is due to custom, pretty,  URL rewriting. However you can enable debugging even with pretty URLs  and URL rewriting.<br />
<span id="more-100"></span><br />
To make this works in simple few steps first make sure that xdebug is  installed and working. To make sure it is installed open you php info  file or create a new php file and fill it with:</p>
<pre class="brush:php">&lt;?php echo phpinfo(); ?&gt;
</pre>
<p>and open it in your browser and make sure that xdebug appears like this:</p>
<div id="attachment_101" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.tiplite.com/wp-content/uploads/2010/08/xdebug-phpinfo.jpg"><img class="size-medium wp-image-101" title="xdebug in phpinfo" src="http://www.tiplite.com/wp-content/uploads/2010/08/xdebug-phpinfo-300x107.jpg" alt="XDebug Section in phpinfo()" width="300" height="107" /></a><p class="wp-caption-text">XDebug Section in phpinfo()</p></div>
<p>If you found xdebug is not installed then you can find many resources on <a href="http://www.google.com/cse?q=how%20to%20install%20xdebug&amp;cx=partner-pub-7208047014320497:k0f870-s2zq" target="_blank">how to install xdebug</a> on Google. If it is already installed then make sure that your xdebug is configured correctly in your php.ini. NetBeans requires xdebug to be configured as follows:</p>
<pre>xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=0.0.0.0 #or your preferred hostname
xdebug.remote_port=9000
</pre>
<div style="text-align: center; margin: 10px auto;">
<script type="text/javascript">// <![CDATA[
google_ad_client = "pub-7208047014320497"; google_ad_slot = "5199664288"; google_ad_width = 468; google_ad_height = 60;
// ]]&gt;</script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript">
</script></div>
<p>Now we will start enabling CakePHP debugging:</p>
<ul>
<li>First you’ll need to create a new CakePHP application using <a href="http://www.google.com/cse?q=CakePHP+console+tools&amp;cx=partner-pub-7208047014320497:k0f870-s2zq">CakePHP console</a> or use current CakePHP application folder.</li>
<li>In NetBeans create a new PHP application and select “PHP Application with Existing Sources” and click next.</li>
<li>Select your application folder and choose a name for you application and click next.</li>
<li>Write your project base URL and make sure to select index.php as your ‘Index File’ and click finish.</li>
<li>Go to Projects panel and right click your project and select  Properties from the menu on left select Sources then select your Web  Root folder, and it is ovious what to select <img src="../wp-includes/images/smilies/icon_smile.gif" alt=":)" /></li>
<li>Run Configuration and click Advanced. From the dialog select “Ask  Every time” and click OK to close the dialog and click OK again to close  Project properties dialog.</li>
</ul>
<p>Now the configurations are complete and you can set break points. To  create a break point you can click on the line number on the left of  source code or write <code>xdebug_break();</code> where you want to stop program execution.</p>
<div id="attachment_103" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.tiplite.com/wp-content/uploads/2010/08/php-breakpoint-sample.jpg"><img class="size-medium wp-image-103" title="php-breakpoint-sample" src="http://www.tiplite.com/wp-content/uploads/2010/08/php-breakpoint-sample-300x107.jpg" alt="Break point in NetBeans" width="300" height="107" /></a><p class="wp-caption-text">Break point in NetBeans</p></div>
<p>When you click debug icon in NetBeans toolbar, or select Debug project from Debug menu (ctrl + F5), NetBeans will show you a box where you enter the URL you want to debug and it will stop execution of the application, and your browser will not continue loading your page until you click Continue.</p>
<div id="attachment_104" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.tiplite.com/wp-content/uploads/2010/08/debug-pane.jpg"><img class="size-medium wp-image-104" title="debug-pane" src="http://www.tiplite.com/wp-content/uploads/2010/08/debug-pane-300x64.jpg" alt="NetBeans PHP debug pane" width="300" height="64" /></a><p class="wp-caption-text">NetBeans PHP debug pane</p></div>
<p>Now you can debug all your CakePHP source code as normal PHP  applications. You can learn how to debug normal PHP application in  NetBeans from <a href="http://netbeans.org/kb/docs/php/debugging.html" target="_blank">this article</a> <!-- AddThis Button BEGIN --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tiplite.com/cakephp-debug-in-netbeans/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Quick tip: Enhanced bash completion in Fedora and CentOS</title>
		<link>http://www.tiplite.com/enhanced-bash-completion-in-fedora-and-centos/</link>
		<comments>http://www.tiplite.com/enhanced-bash-completion-in-fedora-and-centos/#comments</comments>
		<pubDate>Sat, 12 Jun 2010 10:52:47 +0000</pubDate>
		<dc:creator>tiplite</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[bash completion]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Red Hat]]></category>
		<category><![CDATA[tab completion]]></category>

		<guid isPermaLink="false">http://www.tiplite.com/?p=95</guid>
		<description><![CDATA[If you are using fedora or CentOS as a work station or on a VPS you can enhance your bash auto-completion (That appears when you press TAB key). To do this print the following command as root: yum install bash-completion &#8230; <a href="http://www.tiplite.com/enhanced-bash-completion-in-fedora-and-centos/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="ads" style="text-align: center; margin: 20px auto; width: 468px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-7208047014320497";
/* Tiplite-banner */
google_ad_slot = "5199664288";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><p>If you are using <a title="Fedora project" href="http://fedoraproject.org/" target="_blank">fedora</a> or <a title="CentOS" href="http://www.centos.org/" target="_blank">CentOS</a> as a work station or on a <abbr title="Virtual Private Server">VPS</abbr> you can enhance your bash auto-completion (That appears when you press TAB key). To do this print the following command as root:<span id="more-95"></span></p>
<pre class="brush">yum install bash-completion
</pre>
<p>Then open a new bash shell (new terminal if you are using a GUI or logout then login again if you are using ssh or a terminal). This simple package adds powerful completion to your commands, here is a list of what you may expect from this package:</p>
<ul>
<li>Auto-completion for <code>yum</code> commands and packages. Try to write <code> yum in</code> then press tab it will complete it to <code>yum install</code> then try to write a part from a package name and see the magic.</li>
<li>Completion for command args (arguments that starts with &#8211; or &#8211;).</li>
<li>Smart selection of file and folder types with commands like (cd, tar, gunzip, unzip, &#8230;.)</li>
<li>Completion for commands options (just like yum). This works with version control command line tools.</li>
<li>And a lot more &#8230;.</li>
</ul>
<p style="text-align: center;">
<div id="attachment_99" class="wp-caption aligncenter" style="width: 490px"><a href="http://www.tiplite.com/wp-content/uploads/2010/06/mercurial-completion-fedora.png"><img class="size-full wp-image-99 " title="mercurial-completion-fedora" src="http://www.tiplite.com/wp-content/uploads/2010/06/mercurial-completion-fedora.png" alt="Mercurial option auto complete in Fedora" width="480" height="299" /></a><p class="wp-caption-text">Mercurial option auto complete in Fedora</p></div>
<p>For <a title="Ubuntu" href="http://www.ubuntu.com/" target="_blank">Ubuntu</a> users this addition is already installed with default installation.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tiplite.com/enhanced-bash-completion-in-fedora-and-centos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CakePHP support in NetBeans</title>
		<link>http://www.tiplite.com/cakephp-support-in-netbeans/</link>
		<comments>http://www.tiplite.com/cakephp-support-in-netbeans/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 15:22:34 +0000</pubDate>
		<dc:creator>tiplite</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[auto complete]]></category>
		<category><![CDATA[behavior]]></category>
		<category><![CDATA[cake]]></category>
		<category><![CDATA[controller]]></category>
		<category><![CDATA[helpers]]></category>
		<category><![CDATA[introduce variable]]></category>
		<category><![CDATA[model]]></category>
		<category><![CDATA[snippets]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.tiplite.com/?p=84</guid>
		<description><![CDATA[NetBeans is a very powerful development environment for many languages including PHP. With the release of its latest version, NetBeans announced full support for symfony PHP framework. NetBeans can also support many other PHP frameworks and libraries although it is not &#8230; <a href="http://www.tiplite.com/cakephp-support-in-netbeans/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="ads" style="text-align: center; margin: 20px auto; width: 468px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-7208047014320497";
/* Tiplite-banner */
google_ad_slot = "5199664288";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><p>NetBeans is a very powerful development environment for many languages including PHP. With the release of its latest version, NetBeans announced full support for <a title="Symfony PHP framework official site" href="http://www.symfony-project.org/" target="_blank">symfony PHP framework</a>. NetBeans can also support many other PHP frameworks and libraries although it is not officially supported by NetBeans. This support needs some effort to enable some tools specially auto-complete, or intellisense, which saves a lot of time for developers.</p>
<p>We will start to make NetBeans support CakePHP. Firstly we need to create a cake project using cake command line tools.<span id="more-84"></span></p>
<pre class="brush: bash">cd DOCUMENT_ROOT
cake bake PROJECT_NAME</pre>
<p>Then we need to create a NetBeans project using the create files. Click file &gt; New Project, then choose New Project. From the window choose PHP from categories and from projects choose PHP Application with Existing Sources. Click Next then choose the project path. and click finish.</p>
<div id="attachment_87" class="wp-caption aligncenter" style="width: 457px"><a href="http://www.tiplite.com/wp-content/uploads/2010/02/netbeans_new_project.jpg"><img class="size-full wp-image-87 " title="NetBeans New Project Dialog" src="http://www.tiplite.com/wp-content/uploads/2010/02/netbeans_new_project.jpg" alt="NetBeans new project dialog" width="447" height="321" /></a><p class="wp-caption-text">NetBeans New Project Dialog</p></div>
<p>After the project is created select the project in the Projects pane and right click Include Path. Click add folder and choose cake library path and add it. NetBeans will scan and add the library to its internal library.</p>
<div id="attachment_88" class="wp-caption aligncenter" style="width: 417px"><a href="http://www.tiplite.com/wp-content/uploads/2010/02/netbeans_php_include_path.jpg"><img class="size-full wp-image-88 " title="netbeans_php_include_path" src="http://www.tiplite.com/wp-content/uploads/2010/02/netbeans_php_include_path.jpg" alt="NetBeans PHP include path dialog" width="407" height="276" /></a><p class="wp-caption-text">NetBeans PHP include path dialog</p></div>
<div style="margin: 10px auto; text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-7208047014320497";
/* New Banner */
google_ad_slot = "1323901737";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<p>Now you will have auto-complete working in your controllers, models, controllers, behaviors and helpers files. This will happen because NetBeans is smart enough to know that your inheriting AppController, AppModel,&#8230;etc which in turn inherits Controller and Model classes which is found in CakePHP library directory which NetBeans just scanned. But till now we don&#8217;t have support for models and components included magically by CakePHP in controllers and models. To make NetBeans identifies those variables we will use PHPDoc trick. In your model or controller add a variable with the same name of your model or any other model you want, but make sure it is loaded as this will not include your model.</p>
<pre class="brush:php">class ProductsController extends AppController{
    var $name = 'Products';

    /**
     * @var Product
     */
    var $Product;

    /**
     * @var EmailComponent
     */
    var $Email;
}</pre>
<p>You will notice that NetBeans enables auto-complete even in comments. Just hit Ctrl + Space when writing the name of any class. This will work with associated models in a model class.</p>
<p>Now you will notice that your CakePHP work is much more easier, but we still have auto-complete is not working in views. This problem can be solved using NetBeans feature which enables us to define a variable&#8217;s type using comments. I call this feature var-doc or variable type notice. Just write a comment like this before any variable. You even can make this with <code class="brush:php">$this</code> variable to define the class you are working with as <code class="brush:php">View</code> class.</p>
<pre class="brush: php">/* @var $this View */
/* @var $html HtmlHelper */
/* @var $javascript JavascriptHelper */
.....</pre>
<p>This way you can have auto-complete support for your views and helpers included in views and you will notice that NetBeans also has support for your classes in comments.</p>
<p>At last the only thing that I couldn&#8217;t have support for is behaviors methods which can be called from a model&#8217;s instances if you now a way to do this please tell me. But we are waiting for more from NetBeans which has introduced too much for us, PHP Developers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tiplite.com/cakephp-support-in-netbeans/feed/</wfw:commentRss>
		<slash:comments>43</slash:comments>
		</item>
		<item>
		<title>Useful NetBeans 6.8 &#8211; PHP tips</title>
		<link>http://www.tiplite.com/useful-netbeans-6-8-php-tips/</link>
		<comments>http://www.tiplite.com/useful-netbeans-6-8-php-tips/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 22:01:09 +0000</pubDate>
		<dc:creator>tiplite</dc:creator>
				<category><![CDATA[netbeans]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[auto complete]]></category>
		<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[code templates]]></category>
		<category><![CDATA[editor folds]]></category>
		<category><![CDATA[helpers]]></category>
		<category><![CDATA[introduce variable]]></category>
		<category><![CDATA[snippets]]></category>
		<category><![CDATA[views]]></category>
		<category><![CDATA[zen coding]]></category>

		<guid isPermaLink="false">http://www.tiplite.com/?p=67</guid>
		<description><![CDATA[NetBeans has introduced a very powerful development environment for PHP since version 6.5. It has some features that make development even easier. Until NetBeans has launched its 6.8 version, it introduced many features for PHP developers. Here is some features: &#8230; <a href="http://www.tiplite.com/useful-netbeans-6-8-php-tips/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="ads" style="text-align: center; margin: 20px auto; width: 468px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-7208047014320497";
/* Tiplite-banner */
google_ad_slot = "5199664288";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><p>NetBeans has introduced a very powerful development environment for PHP since version 6.5. It has some features that make development even easier. Until NetBeans has launched its 6.8 version, it introduced many features for PHP developers. Here is some features:<span id="more-68"></span></p>
<h3>Code templates</h3>
<p>Code templates is a very powerful feature that can save a lot of time. This templates enables the developer to write few characters which can be expanded to language expressions. Netbeans comes with an excellent group of expressions, but you can add your own templates. Go to tools &gt; options then in the editor section choose Code templates.</p>
<div id="attachment_70" class="wp-caption aligncenter" style="width: 567px"><a href="http://www.tiplite.com/wp-content/uploads/2010/02/code_templates_in_netbeans_1.jpg"><img class="size-full wp-image-70" title="code_templates_in_netbeans_1" src="http://www.tiplite.com/wp-content/uploads/2010/02/code_templates_in_netbeans_1.jpg" alt="Code templates editor in netbeans php" width="557" height="467" /></a><p class="wp-caption-text">Code templates editor in NetBeans PHP editor</p></div>
<p>Some useful templates can be:</p>
<ul>
<li>cls: initialize a class with a contructor.</li>
<li>fnc: expands to a function.</li>
<li>fore: foreach statement (<code>foreach($array as $variable)</code>)</li>
<li>forek: foreach statement with a key (<code>foreach($array as $key =&gt; $var</code>))</li>
</ul>
<p>to expand an abbreviation press tab, you can set expand trigger also in the code templates editor.</p>
<h3>Extend code templates with <a title="Zen coding" href="http://code.google.com/p/zen-coding/">Zen Coding</a></h3>
<p>PHP is usually combined with HTML, although it should only be simple statements in view files if you are using MVC pattern. <a href="http://code.google.com/p/zen-coding/">Zen coding project</a> offers a set of code templates for rapid HTML coding.Unfortunately NetBeans didn&#8217;t get the full power of <a title="Zen coding" href="http://code.google.com/p/zen-coding/">Zen coding</a> yet, it only provides code templates <img src='http://www.tiplite.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> .</p>
<p>Download <a title="Zen coding for NetBeans" href="http://zen-coding.googlecode.com/files/NetBeans.Zen.HTML.1.2.zip">Zen coding for NetBeans</a> you will get a ZIP file. Use the code template editor and click &#8216;Import&#8217; and select this file, then restart NetBeans. Now you get a powerful HTML snippets for NetBeans. You can get a list of all snippets <a title="Zen coding HTML abbreviation" href="http://code.google.com/p/zen-coding/wiki/ZenHTMLElementsEn">here</a>.</p>
<h3>Useful code templates trick, &#8216;surround with&#8217;</h3>
<p>Some code templates in NetBeans, and in the template provided with Zen Coding, can be used to surround some text with a code template. This can be useful if you forget, or needed later, to surround some code with certain code template. An example for this is if conditions, loops, &#8230;.etc. Those code templates can be used if you select the required code. You will find a small yellow light bulb on the left side of the code, click this bulb to show a list of those templates.</p>
<div id="attachment_74" class="wp-caption aligncenter" style="width: 541px"><a href="http://www.tiplite.com/wp-content/uploads/2010/02/netbeans_code_templates_surround_with.jpg"><img class="size-full wp-image-74" title="netbeans_code_templates_surround_with" src="http://www.tiplite.com/wp-content/uploads/2010/02/netbeans_code_templates_surround_with.jpg" alt="NetBeans code templates surround with" width="531" height="344" /></a><p class="wp-caption-text">NetBeans code templates surround with dialog</p></div>
<h3>Introduce a variable</h3>
<p>NetBeans is very smart when it scans for variable types. It utilizes comments, specially <a title="PHP Documentor" href="http://www.phpdoc.org/" target="_blank">PHPDoc</a>. Variable types is very useful when the IDE displays code completion. But sometimes when you are working on many files many IDEs and code editors doesn&#8217;t identify this variable types so the user will miss the code completion feature of the IDE, which saves a lot of time while coding. To retrieve code completion feature again. You can tell NetBeans about the variable type yourself using the following method.</p>
<pre class="brush:php">/* @var $variable VariableType */</pre>
<p>This will tell NetBeans about the variable you are using and if it is an instance of some class NetBeans will show code completion when required. This can be great if you are using a PHP framework that uses MVC pattern. Personally I use this technique to acquire code completion for CakePHP helpers,</p>
<pre class="brush:php">/* @var $html HtmlHelper */
/* @var $javascript JavascriptHelper */
/* @var $form FormHelper */</pre>
<p>Even I could use it to get completion for <code>$this</code> in views like this:</p>
<pre class="brush:php">/* @var $this View */</pre>
<h3>Editor folds</h3>
<p>Editor folds is a way to group some code in a fold and give them a label. Editor folds looks like this:</p>
<div id="attachment_79" class="wp-caption aligncenter" style="width: 455px"><a href="http://www.tiplite.com/wp-content/uploads/2010/02/netbeans_editor_fold.jpg"><img class="size-full wp-image-79" title="netbeans_editor_fold" src="http://www.tiplite.com/wp-content/uploads/2010/02/netbeans_editor_fold.jpg" alt="Editor folds in netbeans" width="445" height="145" /></a><p class="wp-caption-text">Editor folds in NetBeans</p></div>
<p>to create an editor fold with following code:</p>
<pre class="brush:php">//&lt;editor-fold defaultstate="collapsed" desc="your description here ..."&gt;
// your code here ....
//&lt;/editor-fold&gt;</pre>
<p>You can ignore <code>defaultstate="collapsed"</code> to make the code visible just after you open the file. Please take care of order and case of syntax.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tiplite.com/useful-netbeans-6-8-php-tips/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>A Quick jQuery tutorial</title>
		<link>http://www.tiplite.com/a-quick-jquery-tutorial/</link>
		<comments>http://www.tiplite.com/a-quick-jquery-tutorial/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 20:36:38 +0000</pubDate>
		<dc:creator>tiplite</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery how to start]]></category>
		<category><![CDATA[begginers]]></category>
		<category><![CDATA[getting started]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.tiplite.com/?p=60</guid>
		<description><![CDATA[A quick jQuery tutorial which I found during my preparation for &#8216;jQuery How To Start&#8217; series of tutorials for learning the amazing JavaScript library. This is a slideshow which I liked and liked to share it with you. It introduces &#8230; <a href="http://www.tiplite.com/a-quick-jquery-tutorial/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="ads" style="text-align: center; margin: 20px auto; width: 468px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-7208047014320497";
/* Tiplite-banner */
google_ad_slot = "5199664288";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><div>A quick jQuery tutorial which I found during my preparation for &#8216;jQuery How To Start&#8217; series of tutorials for learning the amazing JavaScript library. This is a slideshow which I liked and liked to share it with you. It introduces some basic features of jQuery and shows some advanced uses of this library like jQuery-UI the jquery library which is used to create UI effects and widgets.</div>
<p><span id="more-60"></span></p>
<div style="width: 425px; text-align: left;"><a style="font: 14px Helvetica,Arial,Sans-serif; display: block; margin: 12px 0 3px 0; text-decoration: underline;" title="jQuery from the very beginning" href="http://www.slideshare.net/anisniit/jquery-from-the-very-beginning">jQuery from the very beginning</a><object style="margin: 0px;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=jquery2-090517011324-phpapp02&amp;stripped_title=jquery-from-the-very-beginning" /><param name="allowfullscreen" value="true" /><embed style="margin: 0px;" type="application/x-shockwave-flash" width="425" height="355" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=jquery2-090517011324-phpapp02&amp;stripped_title=jquery-from-the-very-beginning" allowscriptaccess="always" allowfullscreen="true"></embed></object></div>
<div id="__ss_1446662" style="width: 425px; text-align: left;">
<div style="font-size: 11px; font-family: tahoma,arial; height: 26px; padding-top: 2px;">View more <a style="text-decoration: underline;" href="http://www.slideshare.net/">presentations</a> from <a style="text-decoration: underline;" href="http://www.slideshare.net/anisniit">anisniit</a>.</div>
</div>
<div>Please note again this is not part of my own series &#8216;jQuery How To Start&#8217;. However, it should make it easy to understand some basics of jQuery coding. So It is very recommended to show this slideshow.</div>
]]></content:encoded>
			<wfw:commentRss>http://www.tiplite.com/a-quick-jquery-tutorial/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Expand swap space (virtual memory) on a Linux machine</title>
		<link>http://www.tiplite.com/expand-swap-space-virtual-memory-on-a-linux-machine/</link>
		<comments>http://www.tiplite.com/expand-swap-space-virtual-memory-on-a-linux-machine/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 02:12:48 +0000</pubDate>
		<dc:creator>tiplite</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[swap]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://www.tiplite.com/?p=35</guid>
		<description><![CDATA[Linux needs swap space or virtual memory to expand the real memory (RAM), and believe me it won&#8217;t work as expected all the time if there is no sufficient swap space. Swap space usually is setup as a separate partition &#8230; <a href="http://www.tiplite.com/expand-swap-space-virtual-memory-on-a-linux-machine/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="ads" style="text-align: center; margin: 20px auto; width: 468px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-7208047014320497";
/* Tiplite-banner */
google_ad_slot = "5199664288";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><p>Linux needs swap space or virtual memory to expand the real memory (RAM), and believe me it won&#8217;t work as expected all the time if there is no sufficient swap space. Swap space usually is setup as a separate partition which is set during installation or later by the system administrator. But sometimes you need to create extra space for virtual memory for any purpose (Oracle installation for example). But if you don&#8217;t want to mess up with your hard disk, here is a simple way to create a file which serves as a swap partition. <span id="more-35"></span>Execute the following commands as root user in a folder in as partition which has enough disk space</p>
<pre class="brush:bash">dd if=/dev/zero of=swap.swp bs=1024k count=1024
mkswap swap.swp
swapon swap.swp</pre>
<p>The first line created a file called swap.swp from /dev/zero (fill the file with zeros), with 1024 sectors 1024KB each, which makes 1GB file. Then in the second line tells Linux to format, or prepare, the file as swap.  In the next line, turn on the swap space included in the file and adds it to current virtual memory.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tiplite.com/expand-swap-space-virtual-memory-on-a-linux-machine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
