Wells Fargo Cash Back(SM) Program - redemption

If you have the question “Just how to get the freaking cash back out?”, well, in short, you just need to know these two things: Cash rewards can only be redeemed in twenty-five dollar ($25.00) increments. Cash rewards may be redeemed either by automatically applying it to a qualified Wells Fargo Checking, Savings, Loan or Line product (“Redemption Account”) or through a statement credit or paper check by calling Customer Service at 1-800-642-4720. ...

December 5, 2011 · 3 min · birdchan

Commit failed (details follow): File 'your_file' is out of date

I have no idea, but all of a sudden I got this svn error during my commit. My solution is roughly the following. cp your_file your_file.bak svn revert svn update cp your_file.bak your_file svn commit rm your_file.bak A nice workaround that helped me move on.

November 30, 2011 · 1 min · birdchan

17 Keys To Success

Jim Rogers’ Keys to Success (taken from the titles and sub headings of each chapter of the new book, " A Gift To My Children"): 1. Do not let others do your thinking for you 2. Focus on what you like 3. Good habits for life & investing 4. Common sense? not so common 5. Attention to details is what separates success from failure 6. Let the world be a part of your perspective ...

November 30, 2011 · 1 min · birdchan

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

First thing in the morning, I got this mysql server error. ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) Apparently, /tmp/mysql.sock is missing. I know that’s the right path, but the file is not there. I restarted the mysql server by press the “Start MySQL Server” button, but it’s not running. I ran mysqld, but it gave me more errors and failed to start. I ended up making it work by providing a my.cnf file, which I hadn’t needed. ...

November 28, 2011 · 1 min · birdchan

Carrots

November 17, 2011 · 0 min · birdchan

Math problem

Math problems are getting much trickier nowadays…

November 14, 2011 · 1 min · birdchan

PHP command line memory limit error

Very often, when data size gets bigger and bigger, some scripts will break due to default memory limit. I got the following error today. Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /someDir/myScript.php on line 15 Segmentation fault: 11 I checked my php help. I am using version 5.3.6. $ php -h Usage: php [options] [-f] [--] [args...] php [options] -r [--] [args...] php [options] [-B ] -R [-E ] [--] [args...] php [options] [-B ] -F [-E ] [--] [args...] php [options] -- [args...] php [options] -a -a Run as interactive shell -c | Look for php.ini file in this directory -n No php.ini file will be used -d foo[=bar] Define INI entry foo with value 'bar' -e Generate extended information for debugger/profiler -f Parse and execute . -h This help -i PHP information -l Syntax check only (lint) -m Show compiled in modules -r Run PHP without using script tags -B Run PHP before processing input lines -R Run PHP for every input line -F Parse and execute for every input line -E Run PHP after processing all input lines -H Hide any passed arguments from external tools. -s Output HTML syntax highlighted source. -v Version number -w Output source with stripped comments and whitespace. -z Load Zend extension . args... Arguments passed to script. Use -- args when first argument starts with - or script is read from stdin --ini Show configuration file names --rf Show information about function . --rc Show information about class . --re Show information about extension . --ri Show configuration for extension . Looks like -d with do it. So I ran the following: php -d memory_limit=512M myScript.php It worked fine. If you can afford to change your php.ini file, use - -ini to see where your php.ini file is, then make your changes accordingly. You can also use -n to ignore your php.ini file, but then you will be using default parameters which may be even harder to debug. ...

November 11, 2011 · 2 min · birdchan

Validate line by line

Here is a good compilation of codes doing string format validation in C#, VB.NET, Java, Javascript, PHP, Perl, Python, and Ruby. It’s a good reference page. http://answers.oreilly.com/topic/224-how-to-search-line-by-line-with-a-regular-expression/

November 11, 2011 · 1 min · birdchan

Stop UTF 8 with javascript

Below is how you can detect non-ascii characters with javascript. s = $("#something").val(); for (var i=0; n = 128) { alert('Invalid character '' + String.fromCharCode(c) + '''); return false; // or throw an error } } Of course if you have to take in non-ascii values, then be prepared to set up your environments first. The links below will help. http://us.php.net/manual/en/function.base64-encode.php http://pureform.wordpress.com/2008/03/23/make-your-website-completely-utf-8-friendly/

November 9, 2011 · 1 min · birdchan

max_allowed_packet error during mysqldump

Got a “max_allowed_packet” error during mysqldump. This happened after I added a longblob to one of my tables. Below is the error: mysqldump --routines --user=root -p localDB > backup.mysql.txt mysqldump: Error 2020: Got packet bigger than 'max_allowed_packet' bytes when dumping table `table2` at row: 86 It turns out max_allowed_packet is set to something less than whatever is in my row 86. Longblob can go up to 4Gb so I will need to override the max_allowed_packet value. I found the following way the easiest to re-enable the dump. ...

November 8, 2011 · 1 min · birdchan