Saturday, October 27, 2012

Extends your notebook battery's life with Aerofoil

Aerofoil is an application that can help you to enhance your notebook battery life by disabling Aero and some configurations that sucking your battery power. This application is very useful for those of you who use notebooks and away from the power source (wall outlet) and also for those of you who have a notebook with a small capacity battery power. Besides the way to turn off Aero Glass, Aerofoil also disable some setting that has  potential to suck up your battery power.



 If you stick to wall outlet, Aerofoil will automatically set your power plan to "High Performance" which is included:
  • Enable Aero Glass
  • Enable Sound
  • Enable Sidebar 
Meanwhile, if you are runs on battery, Aerofoil will turn your power plan to "Power Saver" which is included:
  • Disable Aero Glass
  • Disable Sound (mute)
  • Disable Sidebar 
This application is open-source, free, and, oh...  it only runs on Windows Vista and 7, both 32-bit and 64-bit. This is a must have tiny app for your  notebook, go get it at http://silentdevelopment.blogspot.com/2010/05/aerofoil-151-released.html

PHP : Switch statement with multiple cases

In PHP programming, sometimes we encounter in a conditions which we have to make a switch statement with multiple case values​​. Previously I was very confused how to make it, but after a bit of experimenting and googling anywhere, I finally find the way. See the code below for more details:
<?

# PHP    : switch with multiple case
# Author : adi@riswan.com

echo "| X | Y | ";
echo "--------- ";

for ($x=1;$x<=5;$x++)
 {
  switch ($x) 
  {
   case 1 :
   case 4 : $y = 'A';
      break;
   case 2 :
   case 5 : $y = 'B';
      break;
   case 3 : $y = 'C';
      break;
  }
 echo "| $x | $y | ";
 }
?>
and the result will be :
| X | Y |
---------
| 1 | A |
| 2 | B |
| 3 | C |
| 4 | A |
| 5 | B |

Thursday, October 25, 2012

MySQL : case sensitive string comparisons

If you want to do a case-sensitive string comparison in MySQL query, you can use the BINARY operator in its query.

Furthermore,  see the screenshot below:


Thursday, October 18, 2012

How to Install Rar / Unrar on CentOS 6.2

CentOS 6.2 comes with no rar / unrar support by default. Here's how to install Rar / Unrar support to CentOS 6.2 (login as root at first) :




For CentOS 32 bit : 
Install rar : 
#wget http://pkgs.repoforge.org/rar/rar-3.8.0-1.el6.rf.i686.rpm
#rpm -Uvh rar-3.8.0-1.el6.rf.i686.rpm

Install unrar : 
#wget http://pkgs.repoforge.org/unrar/unrar-4.0.7-1.el6.rf.i686.rpm
#rpm -Uvh unrar-4.0.7-1.el6.rf.i686.rpm


For CentOS 64 bit : 
Install rar : 
#wget http://pkgs.repoforge.org/rar/rar-3.8.0-1.el6.rf.x86_64.rpm
#rpm -Uvh rar-3.8.0-1.el6.rf.x86_64.rpm

Install unrar : 
#wget http://pkgs.repoforge.org/unrar/unrar-4.0.7-1.el6.rf.x86_64.rpm
#rpm -Uvh unrar-4.0.7-1.el6.rf.x86_64.rpm