Archive for September, 2011

EXTJS Hide Tab Panels

by on Thursday, September 8th, 2011

This is for hide the tab
Ext.getCmp(tabpanel_id).hideTabStripItem(tabitem_id);

This is for show the tab again
Ext.getCmp(tabpanel_id).unhideTabStripItem(tabitem_id);

Prime Number Program

by on Thursday, September 8th, 2011

function IsPrime($number)
{
if ($number < 2) { /* We don’t want zero or one showing up as prime */
return FALSE;
}
for ($i=2; $i<=($number / 2); $i++) {
if($number % $i == 0) { /* Modulus operator, very useful */
return FALSE;
}
}
return TRUE;
}

for($i = 0; $i < 100; $i++)
{
echo $i.” is a prime number? “.IsPrime($i).”
“;
}