My Blog

Blog


WordPress 404 Page Not Working in IE

7.29.2010 | 0 Comments

As stated in the title, my 404 template in WordPress does not show up every time a non-existent URL is accessed in my site. The page works perfectly in FireFox and Chrome, though. So I made a quick search and found that the solution is to add another header information in the page. So here’s what to insert at the very start of 404.php.


<?php ob_start(); ?>
<?php header("HTTP/1.1 404 Not Found"); ?>

For this, credit goes to wpcanada.
http://wpcanada.ca/2008/03/20/ie-and-custom-error-pages/

Read more…


Reset MySQL Root Password in CentOS

7.21.2010 | 0 Comments

“Senior moments” tends to occur more frequently these days. Sign that I’m getting old. And several times already, I forgot the root password of my MySQL installation.

You can recover MySQL database server password with following five easy steps.
Read more…


POSB – PayPal Bank Code and Branch Code

7.17.2010 | 3 Comments

Adding a bank in PayPal is easy especially if you are a POSB/DBS client. But first, you need to know some bank codes to be able to proceed. I did not easily find the needed information from the DBS website (I know it’s somewhere there but I just can’t find it even after scouring the ibanking system). Luckily, UOB has a list of the codes needed as pointed out in the PayPal forum.

So in case I need it again, I’m posting it here. It’s not just for my benefit but also for those who happen to stumble in my site.

Bank Name : Post Office Savings Bank
Institution Code : 7171
Branch Code : 081
Account No : [your 9 digit account number without the dashes]

IMPORTANT NOTE:

  1. All POSB branches has one branch code — 081. The actual branch is embedded in the 9-digit account number.
  2. This is only applicable for POSB accounts with 9 digits account no. Those with 10 digit account numbers must refer to their own respective branches.
  3. Your account name in this form should be the same as your account name in your bank. Otherwise, there will be a SGD5 return fee that will be charged on your paypal account.

Read more…


Oracle IN : Maximum Number of Values

7.10.2010 | 0 Comments

In case you wonder what it the maximum number of values you can put inside the IN condition, it is 1000 as of Oracle 9i. It is documented in the link below.
http://download-east.oracle.com/docs/cd/B10501_01/server.920/a96536/ch44.htm#288033.

Example:

SELECT * FROM emp
WHERE emp_no IN(1,2,3,4,5......1000);

I needed this because I was given a long list of values (around 500 values) and I need to fetch records in a table using that data. It would be easy if I can insert it first into a temp table and then join. Unfortunately, I only have read rights on the database so I need to use the IN condition. But I got concerned because in Oracle 7 and 8i releases, the maximum number of values you can put inside IN is a maximum of 255 (one byte).

Note:

Take note that the IN(SUBQUERY) does not have limitations because that’s essentially a join.

Example:
SELECT * FROM emp
WHERE emp_no IN(SELECT emp_no FROM dept_emp);

However as part of my best practices, I make sure that the results of the IN subquery is either one or none for optimal performance (not applicable in some instances).


My eeePC loves Ubuntu Netbook Edition

4.30.2010 | 0 Comments

I had bad experience with Ubuntu before when I tried to install it on my Compaq V3000 series laptop. You know, the overheating problem that activates the ACPI and then turns off my laptop? Otherwise, my notebook will burn. I mean really, the whole unit is freaking hot.

Of course, I know that it has something to do with the BIOS. But I’m also well aware that I fuck the BIOS update, my laptop will become an expensive paperweight. That’s too big a risk to take a chance. That, coupled with other problems like FarmTown and FarmVille issues, lead me to realize it’s just too painful to make the notebook usable. And so I had to put on Windows XP again. Well, that notebook is primarily used by my wife and FarmTown, FarmVille and Social City are just too important for her so I don’t really have a choice but to put back XP on it.

And so I am stuck with an underpowered netbook, an eeePC 1002HA(btw, it was originally for the wife but since it’s damn slow, she got back the notebook). It’s a pretty decent netbook until I open a lot of tabs on my browser and run netbeans on top of XAMPP. It’s crawling and I understand. It takes ages for Netbeans to start up and do I still need to say that it takes at least 90 seconds to start up the machine(with all the things I run on it)? But then again, the prospect of installing Ubuntu just doesn’t appeal me because of my earlier experience.

So when Ubuntu came up with Ubuntu Netbook Edition (formerly Ubuntu Netbook Remix) and got good reviews, I was persuaded to try again. To make the story short, I installed it (dual-boot mode) and surprisingly, I am now a happy man. I mean, really!

It boots fast, all done and usable in 24 seconds. Yes, that includes all the peripherals like sound, bluetooth and WiFi working! Ok, not as fast as the Macbook Pro but hey, this is a netbook with an underpowered Atom N280 processor with 2GB of memory as compared to Core2Duo of MBP. And guess what, Netbeans starts in a flash.

If all goes well, I might decide to ditch XP altogether and just install VMWare or VirtualBox for my Windows needs. More about this Linux adventure later.